File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ name: Build and release
22
33on :
44 push :
5- branches :
6- - master
75 tags :
86 - ' v*'
97 - ' cabal-install-*'
1412 - cron : ' 0 0 * * *'
1513 workflow_dispatch :
1614
15+ env :
16+ BUILD_LABEL : " run release build"
17+
1718jobs :
19+ check-pr-labels :
20+ name : check PR labels
21+ runs-on : ubuntu-latest
22+ outputs :
23+ run_release_workflow : ${{ steps.gen_output.outputs.apt_tools }}
24+ steps :
25+ - if : ${{ github.event_name == 'pull_request' }}
26+ run : |
27+ run_it=$(if gh api --jq '.labels.[].name' /repos/${{ github.repository }}/pulls/${{ github.event.number }} | grep --quiet '^${{ env.BUILD_LABEL }}$' ; then echo "yes" ; else echo "no" ; fi)
28+ echo run_release_workflow="" >> "$GITHUB_OUTPUT"
29+ shell : bash
30+ env :
31+ GH_TOKEN : ${{ github.token }}
32+
33+ - if : ${{ github.event_name != 'pull_request' }}
34+ run : |
35+ echo run_release_workflow="yes" >> "$GITHUB_OUTPUT"
36+
1837 release-workflow :
38+ needs : ["check-pr-labels"]
39+ if : ${{ needs.check-pr-labels.outputs.run_release_workflow == 'yes' }}
1940 uses : ./.github/workflows/reusable-release.yml
2041 with :
2142 branches : ' ["${{ github.ref }}"]'
You can’t perform that action at this time.
0 commit comments