Skip to content

Commit 4fd0ce7

Browse files
parkerbxyzgr2m
andauthored
ci(test): run on pull request and add concurrency configuration (actions#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 <[email protected]>
1 parent 27ab487 commit 4fd0ce7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: test
2-
on: [push]
2+
on:
3+
pull_request:
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
38

49
jobs:
510
test:
@@ -13,14 +18,14 @@ jobs:
1318
- run: npm ci
1419
- run: npm run build
1520
- uses: ./ # Uses the action in the root directory
16-
id: demo
21+
id: test
1722
with:
1823
app_id: ${{ vars.TEST_APP_ID }}
1924
private_key: ${{ secrets.TEST_APP_PRIVATE_KEY }}
2025
- uses: octokit/[email protected]
2126
id: get-repository
2227
env:
23-
GITHUB_TOKEN: ${{ steps.demo.outputs.token }}
28+
GITHUB_TOKEN: ${{ steps.test.outputs.token }}
2429
with:
2530
route: GET /installation/repositories
2631
- run: echo '${{ steps.get-repository.outputs.data }}'

0 commit comments

Comments
 (0)