Skip to content

Commit e35cee4

Browse files
authored
fix: release action conditional (#1837)
- Closes FE-1452 # Summary Fix conditionals that were deciding if release on NPM or push to the changeset PR # Checklist - [x] I've added error handling for all actions/requests, and verified how this error will show on UI. (or there was no error handling) - [x] I've reviewed all the copy changed/added in this PR, using AI if needed. (or there was no copy changes) - [x] I've included the reference to the issues being closed from Github and/or Linear (or there was no issues) - [x] I've changed the Docs to reflect my changes (or it was not needed) - [x] I've put docs links where it may be helpful (or it was not needed) - [x] I checked the resulting UI both in Light and Dark mode (or no UI changes were made) - [x] I **reviewed** the **entire PR** myself (preferably, on GH UI)
1 parent dfeacd8 commit e35cee4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/release-npm-changeset.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ jobs:
2626
with:
2727
fetch-depth: 0
2828
- id: check-commit
29+
name: Check if this commit is a regular merge or a changeset PR merge
2930
env:
3031
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3132
run: |
32-
if [[ "${{ github.event.head_commit.message }}" == "Merge pull request"* ]]; then
33-
PR_NUMBER=$(echo "${{ github.event.head_commit.message }}" | grep -o '#[0-9]\+' | tr -d '#')
33+
COMMIT_MSG=$(git log -1 --pretty=%B)
34+
FIRST_LINE=$(echo "$COMMIT_MSG" | head -n1)
35+
if [[ "$FIRST_LINE" == "ci(changesets): versioning packages"* ]]; then
36+
PR_NUMBER=$(echo "$FIRST_LINE" | grep -o '#[0-9]\+' | head -n1 | tr -d '#')
3437
if [ -n "$PR_NUMBER" ]; then
3538
PR_TITLE=$(gh pr view "$PR_NUMBER" --json title -q .title)
3639
if [[ "$PR_TITLE" == "ci(changesets): versioning packages" ]]; then

0 commit comments

Comments
 (0)