File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change 3
3
push :
4
4
branches :
5
5
- main
6
+ tags : # To trigger the canary
7
+ - ' *'
6
8
pull_request :
7
9
branches :
8
10
- main
11
+
9
12
jobs :
10
13
build :
14
+ if : ${{ !startsWith(github.ref, 'refs/tags/')}} # Already runs for the push of the commit, no need to run again for the tag
11
15
strategy :
12
16
matrix :
13
17
node-version : [lts/*]
14
18
os : [ubuntu-latest, macos-latest, windows-latest]
15
19
runs-on : ${{ matrix.os }}
16
20
steps :
17
- - uses : actions/checkout@v2
18
- - name : Use Node.js ${{ matrix.node-version }}
19
- uses : actions/setup-node@v2
20
- with :
21
- node-version : ${{ matrix.node-version }}
22
- - run : npm install
23
- - run : npm test
21
+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 https://github.com/actions/checkout/releases/tag/v4.1.1
22
+ - name : Use Node.js ${{ matrix.node-version }}
23
+ uses : actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 https://github.com/actions/setup-node/releases/tag/v3.8.2
24
+ with :
25
+ node-version : ${{ matrix.node-version }}
26
+ - run : npm install
27
+ - run : npm test
28
+
29
+ trigger_canary :
30
+ if : startsWith(github.ref, 'refs/tags/') # Only run when a new package is published (detects when a new tag is pushed)
31
+ runs-on : ubuntu-latest
32
+ steps :
33
+ - name : trigger canary
34
+ run : |
35
+ curl -L -X POST \
36
+ -H "Accept: application/vnd.github+json" \
37
+ -H "Authorization: Bearer ${{ secrets.CANARY_DISPATCH_PAT }}" \
38
+ -H "X-GitHub-Api-Version: 2022-11-28" \
39
+ https://api.github.com/repos/holepunchto/canary-tests/dispatches \
40
+ -d '{"event_type":"triggered-by-${{ github.event.repository.name }}-${{ github.ref_name }}"}'
You can’t perform that action at this time.
0 commit comments