Skip to content

Commit 4a58790

Browse files
authored
build: use head_commit object for checking the bump message (#988)
This PR uses the `head_commit` object from the GitHub context object for checking the bump message. This approach provides a cleaner and more reliable way to detect version bump commits.
1 parent 46d6167 commit 4a58790

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212

1313
jobs:
1414
check:
15-
if: ${{ !startsWith(github.event.commits[0].message, 'bump:') }}
15+
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }}
1616
uses: ./.github/workflows/_build.yaml
1717
permissions:
1818
contents: read
@@ -77,7 +77,7 @@ jobs:
7777
7878
# When triggered by the version bump commit, build the package and publish the release artifacts.
7979
build:
80-
if: github.ref == 'refs/heads/release' && startsWith(github.event.commits[0].message, 'bump:')
80+
if: github.ref == 'refs/heads/release' && startsWith(github.event.head_commit.message, 'bump:')
8181
uses: ./.github/workflows/_build.yaml
8282
permissions:
8383
contents: read

0 commit comments

Comments
 (0)