|
1 | 1 | name: build |
2 | | -on: [push] |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [main] |
| 5 | + pull_request: |
| 6 | + types: [labeled, synchronize] |
3 | 7 |
|
4 | 8 | permissions: |
5 | 9 | contents: write # Create releases and tags |
6 | 10 | pull-requests: write # Comment on PRs with release info |
7 | 11 | packages: write # Publish to GitHub Packages |
8 | 12 |
|
| 13 | +concurrency: |
| 14 | + group: release-${{ github.event.pull_request.number || github.ref }} |
| 15 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 16 | + |
9 | 17 | jobs: |
10 | 18 | build-linting: |
| 19 | + if: github.event_name == 'push' |
11 | 20 | uses: ./.github/workflows/linting.yml |
12 | 21 |
|
13 | 22 | release: |
14 | 23 | needs: [build-linting] |
15 | 24 | runs-on: ubuntu-latest |
16 | | - if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" |
| 25 | + if: >- |
| 26 | + !failure() && !cancelled() && |
| 27 | + ((github.event_name == 'push' |
| 28 | + && !contains(github.event.head_commit.message, 'ci skip') |
| 29 | + && !contains(github.event.head_commit.message, 'skip ci')) |
| 30 | + || (github.event_name == 'pull_request' |
| 31 | + && ((github.event.action == 'labeled' && github.event.label.name == 'canary') |
| 32 | + || (github.event.action == 'synchronize' |
| 33 | + && contains(github.event.pull_request.labels.*.name, 'canary'))))) |
17 | 34 | steps: |
18 | 35 | - name: Checkout repository |
19 | 36 | uses: actions/checkout@v6 |
20 | 37 | with: |
21 | | - fetch-depth: 0 |
| 38 | + fetch-depth: 0 # auto shipit needs full commit graph + tags |
| 39 | + filter: 'blob:none' # skip historical blobs to speed checkout |
22 | 40 | persist-credentials: false # https://stackoverflow.com/questions/74744498/github-pushing-to-protected-branches-with-fine-grained-token |
23 | 41 |
|
24 | 42 | - name: Setup node |
|
0 commit comments