ci(workflows): skip PR creation on release commits to prevent bogus major-version PRs#560
Open
WilliamBerryiii wants to merge 1 commit intomainfrom
Open
ci(workflows): skip PR creation on release commits to prevent bogus major-version PRs#560WilliamBerryiii wants to merge 1 commit intomainfrom
WilliamBerryiii wants to merge 1 commit intomainfrom
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #560 +/- ##
==========================================
- Coverage 85.36% 85.34% -0.03%
==========================================
Files 23 23
Lines 4475 4475
==========================================
- Hits 3820 3819 -1
- Misses 655 656 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the main branch CI workflow to avoid release-please creating spurious major-version release PRs when it runs on release commits (a draft-release tag timing/anchoring issue). It also documents a YAML parsing edge case encountered while implementing the fix so future workflow changes can avoid similar failures.
Changes:
- Add a
skip-github-pull-requestcondition to therelease-please-actionstep to skip PR creation on release commits. - Update the existing workflow comment block to describe the paired mitigation (skip PR creation + manual tag creation).
- Document the YAML “colon-space in plain scalar” expression parsing issue and acceptable solutions in workflow authoring instructions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/main.yml | Skips release-please PR creation on release commits to prevent bogus major bump PRs, while keeping the manual tag-creation workaround. |
| .github/instructions/hve-core/workflows.instructions.md | Adds guidance on quoting GitHub Actions expressions in YAML when : appears inside ${{ }} literals. |
…ajor-version PRs - use shorter prefix to avoid YAML colon-space plain scalar parsing issue - add YAML expression quoting guidance to workflow instructions 🛡️ - Generated by Copilot
4554773 to
60aa4ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prevents release-please from creating bogus v3.0.0 PRs when it runs on release commits. The root cause is a timing issue with
"draft": truein the release-please config: draft releases use lazy tag creation, so the git tag is not materialized until the release is published. Without the tag, release-please cannot locate the draft on subsequent runs, version anchoring fails, and the manifest falls back to scanning all commits — picking up an oldBREAKING CHANGEfooter and proposing un-warranted major bumps.The fix adds
skip-github-pull-requestto the release-please action step, conditioned onstartsWith(github.event.head_commit.message, 'chore(main)'). Release commits carry zero unreleased changes, so skipping PR creation loses nothing. The existing manual tag-creation step ensures subsequent runs find the tag regardless.skip-github-pull-requestconditional tomain.ymlrelease-please step, gated on release-commit prefix detectionworkflows.instructions.mddocumenting the colon-space plain scalar parsing issue and two acceptable solutions in preference orderYAML Expression Quoting Investigation
During implementation,
actionlintrejected the bare expression${{ startsWith(value, 'chore(main): release') }}because the GitHub Actions single-quoted literal': release'contains a colon followed by whitespace. The YAML parser interprets that as a mapping value indicator inside a plain scalar, which is invalid. Seven alternatives were tested:startsWith(msg, 'chore(main): release')': release'has:startsWith(msg, 'chore(main): release')"${{ }}"with:input in repostartsWith(msg, 'chore(main)')format('{0}: release', 'chore(main)')': release'still has:format('{0}{1}{2}', 'chore(main)', ':', ' release')startsWith(msg, 'chore(main):')env.RELEASE_PREFIX+startsWith(msg, env.RELEASE_PREFIX)Option 3 was selected: the shorter prefix
'chore(main)'avoids colon-space entirely, enabling bare${{ }}which matches every otherwith:input in the repo. The specificity tradeoff is acceptable since allchore(main)commits are release-please-generated.Related Issue(s)
Fixes #559
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
prompt-builderagent and addressed all feedback.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md)Other:
.ps1,.sh,.py)Sample Prompts (for AI Artifact Contributions)
Testing
actionlintpassed onmain.ymlwith the final expression formnpm run lint:allpassed (all 8 validation stages: markdown, spell-check, frontmatter, link validation, PowerShell analysis, YAML linting, copyright headers, action version pinning)actionlintto identify the root cause and select the cleanest fix (see investigation table above)Checklist
Required Checks
AI Artifact Contributions
/prompt-analyzeto review contributionprompt-builderreviewRequired Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run lint:md-linksnpm run lint:psSecurity Considerations
Additional Notes
Upstream references:
force-tag-creationfeature request that would eliminate both workaroundsFollow-up: Once release-please-action ships a version containing
force-tag-creationsupport (release-please#2627), both theskip-github-pull-requestconditional and the manual tag-creation step can be replaced with"force-tag-creation": trueinrelease-please-config.json.🛡️ - Generated by Copilot