|
16 | 16 | tags-ignore: |
17 | 17 | - '**' |
18 | 18 | jobs: |
| 19 | + checkExecution: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + outputs: |
| 22 | + shouldExecute: ${{ steps.stepCheckExecution.outputs.shouldExecute }} |
| 23 | + steps: |
| 24 | + - id: stepCheckExecution |
| 25 | + name: Check for execution |
| 26 | + uses: shiftcode/github-action-skip@9d4a90c80567f59dfaacf18fe703a324583c742e #v5.0.0 |
| 27 | + with: |
| 28 | + skipOnCommitMsg: '[skip_build]' |
| 29 | + githubToken: ${{ secrets.GITHUB_TOKEN }} |
19 | 30 | test: |
20 | 31 | runs-on: ubuntu-latest |
| 32 | + needs: checkExecution |
| 33 | + # only execute if not skipped by commit message |
| 34 | + if: needs.checkExecution.outputs.shouldExecute == 'true' |
21 | 35 | strategy: |
22 | 36 | matrix: |
23 | 37 | # Test with Node.js 24 and v25 |
|
31 | 45 | uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd #v5.0.1 |
32 | 46 | # setup node and dependency cache |
33 | 47 | - name: Setup Node and NPM Cache |
34 | | - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 48 | + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0 |
35 | 49 | with: |
36 | 50 | node-version: ${{ matrix.node }} |
37 | 51 | cache: 'npm' |
|
46 | 60 | permissions: |
47 | 61 | contents: write |
48 | 62 | packages: write |
49 | | - needs: test |
| 63 | + needs: [checkExecution, test] |
| 64 | + # only execute if not skipped by commit message |
| 65 | + if: needs.checkExecution.outputs.shouldExecute == 'true' |
50 | 66 | steps: |
51 | 67 | # checkout branch |
52 | 68 | - name: Checkout |
|
56 | 72 | fetch-depth: 0 |
57 | 73 | # setup node and dependency cache |
58 | 74 | - name: Setup Node and NPM Cache |
59 | | - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 75 | + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0 |
60 | 76 | with: |
61 | 77 | node-version-file: .nvmrc |
62 | 78 | cache: 'npm' |
|
84 | 100 | npm run publish-libs |
85 | 101 | env: |
86 | 102 | GITHUB_CONTEXT: ${{ toJson(github) }} |
| 103 | + # necessary to commit on protected branch after merging |
| 104 | + # and to run actions after version-bump commit (otherwise we can't create rules for merging as no workflows run after GITHUB_TOKEN commits) |
| 105 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
0 commit comments