[CI/CD] Release workflows do not trigger on scoped conventional commits (e.g. fix(generator):)
Describe the bug.
In .github/workflows/verify-changeset-release-alignment.yml and .github/workflows/release-with-changesets.yml, release qualification is checked with startsWith:
startsWith(title, 'fix:') ||
startsWith(title, 'fix!:') ||
startsWith(title, 'feat:') ||
startsWith(title, 'feat!:')
Because Conventional Commits v1.0.0 allows scopes (<type>(<scope>): <description>), scoped commits (for example: fix(generator):, fix(hooks):, feat(dart):) evaluate to false.
This creates two issues:
- On PRs: If a PR uses a scoped title (e.g.
fix(hooks): ...) and includes a changeset,verify-changeset-release-alignment.yml(line 34) fails and requests an unscoped prefix. If the PR omits a changeset, line 40 evaluates tofalseand the check passes silently without prompting for one. - On master: When a scoped PR is squash-merged to
master,release-with-changesets.yml(line 19) skips running because of the samestartsWithcondition. Changesets merged with a scoped commit title remain unreleased onmasteruntil an unscoped commit merges later.
Expected behavior
- Clarify whether the repository intended to support scoped Conventional Commits for triggering releases, or if unscoped titles are strictly enforced across the org.
- If scoped commits are supported, both
verify-changeset-release-alignment.ymlandrelease-with-changesets.ymlshould recognize scoped prefixes likefix(scope):andfeat(scope):. - If unscoped titles are strictly enforced by policy, the contributing docs and workflow checks should make this explicit so contributors know before opening PRs.
Screenshots
No response
How to Reproduce
- Test the expression in Node:
node -e "console.log('fix(generator): fix bug'.startsWith('fix:'))" # Prints: false - Real occurrence on
master: Commit3651e21(fix(hooks): bundle emitted AsyncAPI document in generate:after hook (#2189)) added.changeset/bundle-emitted-asyncapi.md. Because the commit had a scope (fix(hooks):),release-with-changesets.ymlskipped running. The changeset remained unreleased onmasterfor 41 days until commit93bd9ce(fix: ...) merged and triggered the release workflow.
Proposed Fix & Guidance Request
If maintainers would like to support scoped conventional commits, we can expand the startsWith expressions in both workflows without adding external dependencies:
- In
.github/workflows/release-with-changesets.yml(line 19):
if: startsWith( github.repository, 'asyncapi/' ) &&
(startsWith( github.event.commits[0].message, 'fix:' ) ||
startsWith( github.event.commits[0].message, 'fix(' ) ||
startsWith( github.event.commits[0].message, 'fix!:' ) ||
startsWith( github.event.commits[0].message, 'feat:' ) ||
startsWith( github.event.commits[0].message, 'feat(' ) ||
startsWith( github.event.commits[0].message, 'feat!:' ) ||
startsWith( github.event.commits[0].message, 'chore(release):'
))
- In
.github/workflows/verify-changeset-release-alignment.yml(line 24):
env:
TITLE_TRIGGERS_RELEASE: ${{ startsWith(github.event.pull_request.title, 'fix:') ||
startsWith(github.event.pull_request.title, 'fix(') ||
startsWith(github.event.pull_request.title, 'fix!:') ||
startsWith(github.event.pull_request.title, 'feat:') ||
startsWith(github.event.pull_request.title, 'feat(') ||
startsWith(github.event.pull_request.title, 'feat!:')
}}
Alternatively, if unscoped titles are intentionally preferred across the org, we can update the alignment check message and contributing guide to state this clearly.
Would love maintainers' guidance on which direction is preferred!
🖥️ Device Information [optional]
- Operating System: Fedora Linux Workstation 44
👀 Have you checked for similar open issues?
- [x] I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- [x] I have read the Contributing Guidelines
Are you willing to work on this issue ?
Yes I am willing to submit a PR!