File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
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
@@ -20,14 +20,19 @@ jobs:
2020 steps :
2121 - name : Check Commit Message
2222 id : check
23+ with :
24+ ref : ${{ github.event.pull_request.head.ref }}
2325 run : |
2426 # Define a regex pattern to match commit messages for changelog updates
2527 CHANGELOG_UPDATE_PATTERN="^Merge pull request #[0-9]+ from ${{ github.repository_owner }}/doc/changelog-update-.*$"
28+ MESSAGE=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }})
2629
27- if [[ "${{ github.event.head_commit.message }} " =~ $CHANGELOG_UPDATE_PATTERN ]]; then
30+ if [[ "MESSAGE " =~ $CHANGELOG_UPDATE_PATTERN ]]; then
2831 echo "This commit is not target. Skip the workflow."
2932 echo "SKIP_JOB=true" >> $GITHUB_OUTPUT
3033 else
34+ echo "This commit is target."
35+ echo "$MESSAGE"
3136 echo "SKIP_JOB=false" >> $GITHUB_OUTPUT
3237 fi
3338 - uses : release-drafter/release-drafter@v6
@@ -104,5 +109,6 @@ jobs:
104109 exit 0
105110 fi
106111 git commit -am "Update Version With Release Draft - $REPLACE_VERSION"
107- git push origin main
112+ BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
113+ git push origin $BRANCH_NAME
108114
You can’t perform that action at this time.
0 commit comments