diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..080eb5a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: '/' + schedule: + interval: 'weekly' diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml new file mode 100644 index 0000000..b6b7eed --- /dev/null +++ b/.github/workflows/pull_requests.yml @@ -0,0 +1,45 @@ +name: PR workflow +on: pull_request + +permissions: + pull-requests: 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}} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/push.yml similarity index 85% rename from .github/workflows/test.yml rename to .github/workflows/push.yml index 40159e0..0c3e381 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/push.yml @@ -1,5 +1,9 @@ -name: test-build -on: push +name: Push workflow +on: + push: + branches: + - master + workflow_dispatch: jobs: test: runs-on: ubuntu-latest @@ -22,4 +26,5 @@ jobs: - run: gatsby build env: GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }} + SNIPCART_API_KEY: 'test' GA_MEASUREMENT_ID: ''