Skip to content

Commit 58957e9

Browse files
julienldclaude
andauthored
fix(ci): support squash merge format in notify workflow (#491)
The workflow was only looking for 'Merge pull request #123' format, which is used for regular merges. When using 'gh pr merge --squash', GitHub creates a squash commit with format 'Title (#123)' instead. **Changes:** - Updated regex to match BOTH formats: - Regular merge: "Merge pull request #123 from..." - Squash merge: "Title (#123)" - Use head -1 to only check first line of commit message **Testing:** - Tested regex with both formats - Regular merge: ✓ Extracts 123 - Squash merge: ✓ Extracts 485 This fixes the workflow not triggering on PR #485 merge. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 614a166 commit 58957e9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/notify-dev-channel.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ jobs:
2929
COMMIT_MSG=$(git log -1 --pretty=%B)
3030
echo "Commit message: $COMMIT_MSG"
3131
32-
# Extract PR number from merge commit
32+
# Extract PR number from commit message
3333
# GitHub merge commits have format: "Merge pull request #123 from user/branch"
34-
PR_NUM=$(echo "$COMMIT_MSG" | grep -oP 'Merge pull request #\K\d+' || echo "")
34+
# GitHub squash merges have format: "Title with (#123)" in first line
35+
PR_NUM=$(echo "$COMMIT_MSG" | head -1 | grep -oP '(?:Merge pull request #|[[(]#)\K\d+' || echo "")
3536
3637
if [ -z "$PR_NUM" ]; then
37-
echo "No PR number found in merge commit. Skipping notification."
38+
echo "No PR number found in commit message. Skipping notification."
3839
echo "skip=true" >> $GITHUB_OUTPUT
3940
exit 0
4041
fi

0 commit comments

Comments
 (0)