File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 1010
1111jobs :
1212 pre-release :
13- if : github.event.pull_request.merged == true || github.ref == 'refs/heads/main'
13+ if : github.event.pull_request.merged == true
1414 runs-on : ubuntu-latest
1515
1616 steps :
2121 with :
2222 version : ${{ env.HELM_VERSION }}
2323
24+ - name : install github cli
25+ run : |
26+ sudo apt-get update
27+ sudo apt-get install -y gh
28+
29+ - name : check if 'release-apply' label exists
30+ id : check_label
31+ run : |
32+ PR_NUMBER=${{ github.event.pull_request.number }}
33+ LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name')
34+ echo "Labels: $LABELS"
35+ if echo "$LABELS" | grep -q "release-apply"; then
36+ echo "Label 'release-apply' found."
37+ echo "release_apply=true" >>$GITHUB_OUTPUT
38+ else
39+ echo "Label 'release-apply' not found."
40+ echo "release_apply=false" >>$GITHUB_OUTPUT
41+ fi
42+ env :
43+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44+
45+ - name : early exit if release-apply is not present
46+ if : steps.check_label.outputs.release_apply == 'false'
47+ run : |
48+ echo "The pull request is merged and does not have the 'release-apply' label. Existing with success"
49+ exit 0
50+
2451 - name : determine version increment
2552 id : determine-version
2653 run : |
You can’t perform that action at this time.
0 commit comments