Skip to content

Commit

Permalink
Merge pull request #29 from flotiq/feature/add-dependabot
Browse files Browse the repository at this point in the history
add changed workflows
  • Loading branch information
CiotkaCierpienia committed Mar 26, 2024
2 parents b6340ca + de691ad commit 4c8a989
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: '/'
schedule:
interval: 'weekly'
51 changes: 51 additions & 0 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PR workflow
on: pull_request

permissions:
pull-requests: write
contents: write

jobs:
test-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g gatsby-cli
- run: npm install -g flotiq-cli
- run: flotiq import . ${{ secrets.GATSBY_FLOTIQ_API_KEY }}
- run: yarn install
- run: gatsby build
env:
GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }}
SNIPCART_API_KEY: 'test'
GA_MEASUREMENT_ID: ''
dependabot:
needs: test-build
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
11 changes: 8 additions & 3 deletions .github/workflows/test.yml → .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: test-build
on: push
name: Push workflow
on:
push:
branches:
- master
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -23,4 +28,4 @@ jobs:
env:
GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }}
SNIPCART_API_KEY: 'test'
GA_MEASUREMENT_ID: ''
GA_MEASUREMENT_ID: ''

0 comments on commit 4c8a989

Please sign in to comment.