Skip to content

fix(ci): scope coverage PR-body injection to release PRs, derive badge filename per branch - #239

Merged
Shinrai merged 2 commits into
nextfrom
fix/coverage-pr-body-scope-and-badge-filename
Aug 20, 2026
Merged

fix(ci): scope coverage PR-body injection to release PRs, derive badge filename per branch#239
Shinrai merged 2 commits into
nextfrom
fix/coverage-pr-body-scope-and-badge-filename

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

No other changes

👥 Contributors

…e filename per branch

The coverage-pr-comment job in workflow-ci.yml gated only on
github.event_name == 'pull_request', so every feature PR into next got
whole-repo coverage injected into its description alongside the two
persistent release PRs. Key on github.head_ref instead, which is only
'next'/'hotfixes' for those release PRs.

Also derive badge_filename per branch (coverage.json for the default
branch, coverage-<branch>.json otherwise) so a future widening of the
coverage-badge trigger to next/hotfixes can't clobber master's badge
JSON with theirs. A caller-supplied non-default filename still wins.

Fixes #238
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch type: ci Changes to CI workflows, actions, or build pipelines labels Aug 20, 2026
@Shinrai

Shinrai commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Resolves #238 — closed when this ships to the default branch.

Shinrai
Shinrai previously approved these changes Aug 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 org-level CI entrypoint workflow to (1) avoid injecting coverage details into non-release PR descriptions and (2) avoid badge JSON filename collisions when publishing coverage from multiple branches.

Changes:

  • Derive badge_filename from the current branch name (unless explicitly overridden) to prevent badge JSON clobbering across branches.
  • Restrict the PR coverage body-injection job to only run on the two persistent release PR source branches (next, hotfixes).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/workflow-ci.yml Outdated
Comment thread .github/workflows/workflow-ci.yml Outdated
…list badge filenames

Addresses Copilot review on PR #239:

- coverage-pr-comment gated only on head_ref == 'next'/'hotfixes', which a
  fork PR could spoof by naming its own head branch 'next'/'hotfixes' and
  running the job (pull-requests: write + bot secrets) against untrusted
  code. Add a same-repo check.

- badge_filename derived via format('coverage-{0}.json', github.ref_name)
  against an arbitrary ref; GitHub Actions expressions have no
  string-replace function, so a branch name containing '/' would flow
  straight into the filename and break push-badge (no intermediate
  directory creation). Replace the open-ended format() with an explicit
  allowlist of the two known integration branch names (both guaranteed
  slash-free), falling back to the existing coverage.json otherwise.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@Shinrai
Shinrai merged commit 0cfed3d into next Aug 20, 2026
15 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/coverage-pr-body-scope-and-badge-filename branch August 20, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

! fix → next v4 flow: fix contributor PR targeting the next integration branch type: ci Changes to CI workflows, actions, or build pipelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants