From 22441d5d656cecad4b327a14c117ae567594d88a Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:46:24 -0700 Subject: [PATCH 1/6] Rename step ID from `demo` to `test` --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22176f25..e6c482f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,14 +13,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 }}' From bd64bda2bfd18fde85490fec65996f3c9e8b42e5 Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:46:57 -0700 Subject: [PATCH 2/6] Run test on pull request instead of push --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6c482f1..46b6c820 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,7 @@ name: test -on: [push] +on: + pull_request: + branches: [main] jobs: test: From de62487d41af51b04415726adc22b2393594239d Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:53:43 -0700 Subject: [PATCH 3/6] Add concurrency configuration This will 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. This reduces unnecessary compute time. --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 46b6c820..e03807ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,10 @@ on: pull_request: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest From b07e73d82b63d686f6e032aaea877b0d44b3f054 Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Tue, 22 Aug 2023 08:57:08 -0700 Subject: [PATCH 4/6] Apply suggestion from code review Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com> --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e03807ea..74a5de93 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,9 @@ name: test on: - pull_request: - branches: [main] + push: + branches: + - main + pull_request_target: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 3c0003fed3471f6a6c1eb90c4980d5b5b20f4ddd Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:23:31 -0700 Subject: [PATCH 5/6] Revert "Apply suggestion from code review" This reverts commit b07e73d82b63d686f6e032aaea877b0d44b3f054. --- .github/workflows/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 74a5de93..e03807ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,7 @@ name: test on: - push: - branches: - - main - pull_request_target: + pull_request: + branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From e1bbf5878337474d24e37a169a2e270804e48d08 Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:18:11 -0700 Subject: [PATCH 6/6] Run on all pull requests --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e03807ea..749cda20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,6 @@ name: test on: pull_request: - branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }}