From 4fd0ce7c2973194c181299acb6c324e2b80766a2 Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:30:49 -0700 Subject: [PATCH] ci(test): run on pull request and add concurrency configuration (#17) - Run test on pull requests to the main branch instead of on every push - Cancel in-progress workflows if a PR is updated (i.e., a new commit is pushed) and the same workflows are triggered to run again - Rename step ID from `demo` to `test` --------- Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com> --- .github/workflows/test.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22176f2..749cda2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,10 @@ name: test -on: [push] +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: test: @@ -13,14 +18,14 @@ jobs: - run: npm ci - run: npm run build - uses: ./ # Uses the action in the root directory - id: demo + id: test with: app_id: ${{ vars.TEST_APP_ID }} private_key: ${{ secrets.TEST_APP_PRIVATE_KEY }} - uses: octokit/request-action@v2.x id: get-repository env: - GITHUB_TOKEN: ${{ steps.demo.outputs.token }} + GITHUB_TOKEN: ${{ steps.test.outputs.token }} with: route: GET /installation/repositories - run: echo '${{ steps.get-repository.outputs.data }}'