1313 version :
1414 description : tag the latest commit on main with the given version (prefixed with v)
1515 required : true
16+ skip-checks :
17+ description : skip the check-gate (release even if checks have not passed)
18+ required : false
19+ type : boolean
20+ default : false
1621
1722jobs :
1823 version-available :
2328 version : ${{ github.event.inputs.version }}
2429
2530 check-gate :
31+ if : ${{ !inputs.skip-checks }}
2632 permissions :
33+ contents : read # required for the reusable workflow to check out the repo
2734 checks : read # required for getting the status of specific check names
2835 uses : anchore/workflows/.github/workflows/check-gate.yaml@8b2b1caf40e03933c6807e03b99e883e2ceb5ac8 # v0.4.0
2936 with :
@@ -33,10 +40,18 @@ jobs:
3340
3441 release :
3542 needs : [check-gate, version-available]
36- environment : release # gates release on required reviewers; provides DEPLOY_KEY secret
43+ # run even when check-gate is skipped, but never when version-available
44+ # failed/was skipped, nor when check-gate failed or was cancelled. note:
45+ # always() disables the implicit success() gate on ALL needs, so the
46+ # version-available requirement must be re-asserted explicitly here.
47+ if : >-
48+ ${{ always()
49+ && needs.version-available.result == 'success'
50+ && !contains(fromJSON('["failure", "cancelled"]'), needs.check-gate.result) }}
51+ environment : release # gates release on required reviewers
3752 runs-on : ubuntu-24.04
3853 permissions :
39- contents : read # tag pushes go via deploy key , not GITHUB_TOKEN
54+ contents : read # tag pushes go via TAG_TOKEN , not GITHUB_TOKEN
4055 steps :
4156 - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4257 with :
5570 - name : Create release
5671 env :
5772 GITHUB_TOKEN : ${{ github.token }}
58- DEPLOY_KEY : ${{ secrets.DEPLOY_KEY }}
73+ # for pushing tags (does not inherit workflow permissions)
74+ TAG_TOKEN : ${{ secrets.TAG_TOKEN }}
5975 RELEASE_VERSION : ${{ github.event.inputs.version }}
6076 run : make ci-release
0 commit comments