Skip to content

ci: skip breaking-changes entirely on push, not just its own check - #106

Open
o-nnerb wants to merge 1 commit into
mainfrom
fix/breaking-changes-skip-on-push
Open

o-nnerb wants to merge 1 commit into
mainfrom
fix/breaking-changes-skip-on-push

Conversation

@o-nnerb

@o-nnerb o-nnerb commented Sep 18, 2026

Copy link
Copy Markdown
Member

Summary

  • The `breaking-changes` job already skips its own check on a push to `main` (the run step's own `github.event_name != 'pull_request'` guard) and already skips entirely on a PR labeled `breaking-changes` (the job-level `if:`) — but on push it still spins up a runner, checks out the repo, and restores the SwiftPM cache before noticing it has nothing to do and exiting 0. That reads as the check actually running (green, ~24s) when it's really a no-op, and wastes CI minutes on every push to `main`.
  • Moves the `pull_request`-only guard into the job-level `if:`, next to the existing label-based skip, so a push to `main` skips the whole job (shown as skipped, not run) instead of spinning up and immediately exiting.
  • Removes the now-unreachable runtime early-exit from the run step, since the job itself never executes on a non-PR event anymore.

Test plan

  • `python3 -c "import yaml; yaml.safe_load(...)"` — valid YAML
  • `actionlint` — clean
  • Verify on the next push to `main` in a consuming repo that "💔 Breaking Changes" shows as skipped, not a fast green run

The job still spun up a runner, checked out the repo, and restored the
SwiftPM cache on every push to main, only to have its run step notice
github.event_name != 'pull_request' and exit 0 immediately -- wasted
minutes, and reads as the check actually running when it isn't. Move
that guard into the job-level if: so a push to main skips the job
outright, matching the existing 'breaking-changes' label skip that
already lives there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant