Skip to content

fix(slack): Fix multi-scope categorization, filter merge commits, upgrade to Block Kit#117

Merged
duckdum merged 1 commit intomainfrom
fix/improve-slack-release-notifications
Mar 27, 2026
Merged

fix(slack): Fix multi-scope categorization, filter merge commits, upgrade to Block Kit#117
duckdum merged 1 commit intomainfrom
fix/improve-slack-release-notifications

Conversation

@duckdum
Copy link
Copy Markdown
Collaborator

@duckdum duckdum commented Mar 26, 2026

Slack message_ts: 1774550949.224129

Summary

  • Fix multi-scope regex: Changed /^\w+\(([\w,]+)\):/ to /^\w+\(([\w,\s]+)\):/ so commits like chore(companion, bs, frontend): are correctly parsed instead of falling into "other"
  • Place multi-scope commits under primary scope: Multi-scope commits (e.g. chore(companion, bs, frontend):) are now placed under the first (primary) scope only, instead of duplicating across all scopes
  • Filter merge commits: Removes Merge branch '...', Merge remote-tracking branch '...', and Merge pull request #... from the initial commit list (does not affect synchronize event notifications)
  • Upgrade to Slack Block Kit: When sort-commits=true, sends structured Block Kit messages with headers per scope, type groupings, dividers, and changelog link. Includes chunking for Slack's 50-block limit. Falls back to plain text when sort-commits=false (fully backward compatible)
  • Handle empty commits: Posts "No conventional commits to display." when all commits are filtered out

Test plan

  • All 33 tests pass (npm test)
  • npm run build generates dist/index.js successfully
  • Preview Block Kit output in Slack Block Kit Builder
  • End-to-end test with a release PR referencing the updated action

@duckdum duckdum force-pushed the fix/improve-slack-release-notifications branch 2 times, most recently from d5d4ab2 to 8061d2c Compare March 26, 2026 21:39
…rade to Block Kit

- Fix regex to allow spaces in multi-scope commits (e.g. "chore(companion, bs, frontend):")
- Place multi-scope commits under first (primary) scope only
- Filter out merge commits (Merge branch, Merge remote-tracking, Merge pull request)
- Add Block Kit formatted output when sort-commits is enabled:
  - Scopes sorted alphabetically with headers
  - Types sorted alphabetically within each scope
  - Commits sorted by author within each type
  - Section splitting to respect Slack's 3000-char block text limit
  - Payload-based chunking to respect Slack's ~40KB message limit
- Use only first line of commit message in synchronize notifications
- Handle edge case when all commits are filtered out
- Add error logging for failed Slack block posts
- Enable sort-commits in workflow
@duckdum duckdum force-pushed the fix/improve-slack-release-notifications branch from 2614137 to d473c0b Compare March 26, 2026 22:22
@duckdum duckdum requested a review from mduchev March 26, 2026 22:25
@duckdum duckdum changed the title Fix multi-scope categorization, filter merge commits, upgrade to Block Kit fix(slack): Fix multi-scope categorization, filter merge commits, upgrade to Block Kit Mar 26, 2026
@duckdum duckdum merged commit 31162ca into main Mar 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants