File tree Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7+ pull_request :
78 workflow_dispatch :
89
910jobs :
1011 update_release_draft :
11- if : ${{ !contains(github.head_ref, 'doc/changelog-update-') && startsWith(github.event.head_commit.message, 'Merge pull request') }}
1212 permissions :
1313 contents : write
1414 pull-requests : write
1515 runs-on : ubuntu-latest
1616 timeout-minutes : 30
17- outputs :
18- skip_job : ${{ steps.check.outputs.SKIP_JOB }}
1917
2018 steps :
21- - name : Check Commit Message
22- id : check
23- run : |
24- # Define a regex pattern to match commit messages for changelog updates
25- CHANGELOG_UPDATE_PATTERN="^Merge pull request #[0-9]+ from ${{ github.repository_owner }}/doc/changelog-update-.*$"
26-
27- if [[ "${{ github.event.head_commit.message }}" =~ $CHANGELOG_UPDATE_PATTERN ]]; then
28- echo "This commit is not target. Skip the workflow."
29- echo "SKIP_JOB=true" >> $GITHUB_OUTPUT
30- else
31- echo "SKIP_JOB=false" >> $GITHUB_OUTPUT
32- fi
3319 - uses : release-drafter/release-drafter@v6
3420 env :
3521 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3824
3925 update_version :
4026 needs : update_release_draft
41- if : ${{ needs.update_release_draft.outputs.skip_job != 'true' }}
27+ if : ${{ !contains(github.head_ref, 'doc/changelog-update-') && startsWith(github.event.head_commit.message, 'Merge pull request') }}
4228 runs-on : ubuntu-latest
4329 timeout-minutes : 30
4430 permissions :
10389 echo "No changes to commit."
10490 exit 0
10591 fi
106- git commit -am "Update Version With Release Draft - $REPLACE_VERSION"
107- git push origin main
92+ git commit -am "Update Version With Release Draft - $RELEASE_VERSION"
93+ BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
94+ git push origin $BRANCH_NAME
10895
You can’t perform that action at this time.
0 commit comments