Stop running CI twice on every pull request - #89
Merged
Merged
Conversation
`push` matched every branch and `pull_request` matched the same commits, so both fired on one commit and the whole workflow ran twice. On #87 the head commit carried two CI runs and 10 check runs -- one full set per event. They were never a "branch" run and a "merge" run; they were the same commit checked twice. Scope `push` to `main`. Merges still run CI. Drop the `pull_request` base filter as well, so a pull request against any base is covered rather than only those targeting `main`. What this gives up is CI on a branch with no pull request open, and nothing else. `pull_request` checks out the branch already merged into its base, so merge coverage is unaffected. `workflow_dispatch` replaces the lost case (`gh workflow run ci.yml --ref <branch>`), and opening the pull request as a draft works too -- nothing here filters drafts. Release automation is unaffected: release branches land through pull requests in this organization, so the `pull_request` trigger still covers them. Closes #88
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.
Closes #88.
Every pull request ran the whole CI workflow twice — same commit, two events. On #87 the head commit carried two CI runs and 10 check runs.
What changed
.github/workflows/ci.yml, trigger block only:push: branches: [main]— merges intomainstill run. The redundant pull-request-branch copy is what goes away.pull_request:unfiltered — a pull request against any base now gets CI, not only those targetingmain.aicers/aimer-web,aicers/review-protocolandaicers/review-databasealready used this bare form.workflow_dispatch:— replaces the one thing lost, below.What this gives up
A branch with no open pull request no longer gets CI automatically. That is the whole cost.
Not lost:
pull_requestchecks outrefs/pull/N/merge— the branch already merged into its base — so merge-result coverage is unaffected, and pushes tomainare still covered.Replacements, in order of directness:
gh workflow run ci.yml --ref <branch>(available once this is onmain, sinceworkflow_dispatchhas to be registered from the default branch); opening the pull request as a draft, which firespull_requestopened— nothing in this workflow filters drafts; or running the checks locally.Verification
ci.ymlno longer matchespushmainPrior art:
aicers/bootler,aicers/aimer-webandaicers/cluml-homealready scopepushto the default branch; bootler documents the reasoning in itsci.ymlheader.actionlint(with shellcheck) is clean on the result.Out of scope