Skip to content

ci(workflows): skip PR creation on release commits to prevent bogus major-version PRs#560

Open
WilliamBerryiii wants to merge 1 commit intomainfrom
ci/skip-release-pr-on-release-commit
Open

ci(workflows): skip PR creation on release commits to prevent bogus major-version PRs#560
WilliamBerryiii wants to merge 1 commit intomainfrom
ci/skip-release-pr-on-release-commit

Conversation

@WilliamBerryiii
Copy link
Member

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": true in 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 old BREAKING CHANGE footer and proposing un-warranted major bumps.

The fix adds skip-github-pull-request to the release-please action step, conditioned on startsWith(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.

  • ci(workflows): added skip-github-pull-request conditional to main.yml release-please step, gated on release-commit prefix detection
  • ci(workflows): updated the workaround comment block to reference both the skip conditional and the manual tag creation as a paired mitigation
  • docs(instructions): added "YAML Expression Quoting" section to workflows.instructions.md documenting the colon-space plain scalar parsing issue and two acceptable solutions in preference order

YAML Expression Quoting Investigation

During implementation, actionlint rejected 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:

# Expression YAML Quoting actionlint Notes
1 startsWith(msg, 'chore(main): release') bare FAIL ': release' has :
2 startsWith(msg, 'chore(main): release') "${{ }}" PASS Only double-quoted with: input in repo
3 startsWith(msg, 'chore(main)') bare PASS Selected — shorter prefix, no colon-space
4 format('{0}: release', 'chore(main)') bare FAIL ': release' still has :
5 format('{0}{1}{2}', 'chore(main)', ':', ' release') bare PASS Over-engineered
6 startsWith(msg, 'chore(main):') bare PASS Colon without space is fine
7 env.RELEASE_PREFIX + startsWith(msg, env.RELEASE_PREFIX) bare PASS Adds indirection

Option 3 was selected: the shorter prefix 'chore(main)' avoids colon-space entirely, enabling bare ${{ }} which matches every other with: input in the repo. The specificity tradeoff is acceptable since all chore(main) commits are release-please-generated.

Related Issue(s)

Fixes #559

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Note for AI Artifact Contributors:

  • Agents: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review .github/agents/ before creating new ones.
  • Skills: Must include both bash and PowerShell scripts. See Skills.
  • Model Versions: Only contributions targeting the latest Anthropic and OpenAI models will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected.
  • See Agents Not Accepted and Model Version Requirements.

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Sample Prompts (for AI Artifact Contributions)

Testing

  • actionlint passed on main.yml with the final expression form
  • npm run lint:all passed (all 8 validation stages: markdown, spell-check, frontmatter, link validation, PowerShell analysis, YAML linting, copyright headers, action version pinning)
  • Seven YAML expression quoting alternatives were systematically tested with actionlint to identify the root cause and select the cleanest fix (see investigation table above)

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues
  • Security-related scripts follow the principle of least privilege

Additional Notes

Upstream references:

Follow-up: Once release-please-action ships a version containing force-tag-creation support (release-please#2627), both the skip-github-pull-request conditional and the manual tag-creation step can be replaced with "force-tag-creation": true in release-please-config.json.

🛡️ - Generated by Copilot

@WilliamBerryiii WilliamBerryiii requested a review from a team as a code owner February 14, 2026 05:42
Copilot AI review requested due to automatic review settings February 14, 2026 05:42
@github-actions
Copy link

github-actions bot commented Feb 14, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.34%. Comparing base (d3bdd7a) to head (60aa4ed).

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
pester 85.34% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-request condition to the release-please-action step 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
@WilliamBerryiii WilliamBerryiii force-pushed the ci/skip-release-pr-on-release-commit branch from 4554773 to 60aa4ed Compare February 14, 2026 05:59
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.

fix(workflows): add skip-github-pull-request conditional to prevent bogus release PRs

2 participants