Skip to content

fix(ci): add missing steps key in cleanup-branches.yml - #1075

Merged
ashleyshaw merged 5 commits into
developfrom
fix/cleanup-branches-workflow-missing-steps-key
Jul 22, 2026
Merged

fix(ci): add missing steps key in cleanup-branches.yml#1075
ashleyshaw merged 5 commits into
developfrom
fix/cleanup-branches-workflow-missing-steps-key

Conversation

@ashleyshaw

Copy link
Copy Markdown
Member

Bugfix Pull Request

This repository enforces changelog, release, and label automation for all PRs and issues.
See the organisation-wide Automation Governance & Release Strategy for required rules.

Linked issues

Closes#1074

Context

  • Severity/Impact: High — breaks the required All Checks Passed status check for every PR into develop, not just ones touching this file.
  • Affected versions/environments: develop branch CI (repo-wide npm run lint:all).

Reproduction

  • Steps: 1) checkout develop 2) npm run lint:all 3) observe spectral parser errors at .github/workflows/cleanup-branches.yml:37-46.
  • Expected vs Actual: Expected clean lint; actual 16 problems (16 errors) from invalid YAML.

Root Cause

Fix Summary

  • Added the missing steps: key at the correct indentation before the existing step list. No behavioural change to the cleanup logic itself, since it was never valid to begin with.

Verification

  • Tests added/updated to cover the bug — N/A, single-line YAML structure fix; verified via js-yaml parse and npx spectral lint locally (zero errors), plus the full local npm test suite (670/670 passing) via the pre-push hook.
  • Manual verification steps (browsers/devices) — N/A, workflow-only change.
  • Negative/edge cases checked — confirmed the parsed job now has all 6 expected steps in order.

Risk & Rollback

  • Risk level: Low
  • Rollback plan: revert this commit; the workflow returns to its previously-broken (but no worse) state.

Changelog

Fixed

  • Fixed invalid YAML in cleanup-branches.yml (missing steps: key) that broke npm run lint:all for every PR into develop.

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (unit/E2E as appropriate)
  • Accessibility checklist completed (where relevant): N/A — no UI
  • Docs/readme/changelog updated (if user-facing) — changelog entry above
  • Security checklist completed (where relevant): N/A — no untrusted input, no run: command changes
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

The cleanup job's env mapping was immediately followed by a
`- name: Checkout repository` list item with no `steps:` parent key,
which is invalid YAML. Since npm run lint:all lints every workflow
file (not just changed ones), this broke the required "All Checks
Passed" status check for every PR into develop.
Closes#1074
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in:54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 53f11a75-d9d0-40a2-a01b-8bbe0a70319d

📥 Commits

Reviewing files that changed from the base of the PR and between 3afe7fd and c3ad168.

📒 Files selected for processing (2)
  • .github/workflows/cleanup-branches.yml
  • CHANGELOG.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cleanup-branches-workflow-missing-steps-key

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

@github-actionsgithub-actionsBot added status:needs-review Awaiting code review type:bug Bug or defect priority:normal Default priority area:ci Build and CI pipelines type:chore Chore / small hygiene change meta:needs-changelog Requires a changelog entry before merge labels Jul 22, 2026
@github-actions

github-actionsBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1075

CI Status:success
Files changed: 2
Risk Distribution: 1 critical, 0 high, 0 medium, 1 low

Recommendations

  • ⚠️ 1 critical-risk file(s) modified (workflows, secrets)
  • ⚠️ Security-sensitive files modified (review carefully)

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:7ac1ac2f4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Match merged branch refs exactly before enabling deletion

Adding steps activates the scheduled live cleanup (--dryRun=false), but scripts/cleanup-branches.js:216-222 determines merge status with substring matching. If an old, unmerged branch named topic/foo exists while the longer topic/foobar is merged, the output from git branch -r --merged contains origin/topic/foobar, so .includes("origin/topic/foo") incorrectly classifies topic/foo as merged and the workflow deletes it. Git's git branch -h defines --merged <commit> as “print only branches that are merged”; parse those output lines for exact equality or use an ancestry check before allowing live deletion.

Useful? React with 👍 / 👎.

@github-actionsgithub-actionsBot removed the type:chore Chore / small hygiene change label Jul 22, 2026
@ashleyshaw
ashleyshaw enabled auto-merge (squash) July 22, 2026 10:21
Required by the repo's "Require changelog update or skip label" check,
which needs an actual CHANGELOG.md diff (the meta:no-changelog skip
label isn't allowed for type:bug PRs).
Relates to #1074
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ashleyshaw
ashleyshaw merged commit a3a327c into developJul 22, 2026
25 checks passed
@ashleyshaw
ashleyshaw deleted the fix/cleanup-branches-workflow-missing-steps-key branch July 22, 2026 10:57
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ciBuild and CI pipelinesarea:documentationDocs & guideslang:mdMarkdown content/docsmeta:needs-changelogRequires a changelog entry before mergepriority:normalDefault prioritystatus:needs-reviewAwaiting code reviewtype:bugBug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cleanup-branches.yml has invalid YAML (missing steps: key), breaking lint:yaml for every PR

1 participant

@ashleyshaw