Skip to content

Stop running CI twice on every pull request - #89

Merged
sehkone merged 1 commit into
mainfrom
sehkone/issue-88
Aug 4, 2026
Merged

Stop running CI twice on every pull request#89
sehkone merged 1 commit into
mainfrom
sehkone/issue-88

Conversation

@sehkone

@sehkone sehkone commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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:

on:
  pull_request:
  push:
    branches: [main]
  workflow_dispatch:
  • push: branches: [main] — merges into main still 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 targeting main. aicers/aimer-web, aicers/review-protocol and aicers/review-database already 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_request checks out refs/pull/N/merge — the branch already merged into its base — so merge-result coverage is unaffected, and pushes to main are still covered.

Replacements, in order of directness: gh workflow run ci.yml --ref <branch> (available once this is on main, since workflow_dispatch has to be registered from the default branch); opening the pull request as a draft, which fires pull_request opened — nothing in this workflow filters drafts; or running the checks locally.

Verification

Case Expected Result
Push this branch no run — the pushed ref's own ci.yml no longer matches push ✅ 0 runs on the head commit after push
Open this pull request exactly one CI run see the checks below — one run, where #87 had two
Merge to main CI still runs to be recorded after merge

Prior art: aicers/bootler, aicers/aimer-web and aicers/cluml-home already scope push to the default branch; bootler documents the reasoning in its ci.yml header.

actionlint (with shellcheck) is clean on the result.

Out of scope

  • Path filtering for documentation-only changes, and markdownlint coverage — separate issues.
  • Every other workflow file in this repository.

`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
@sehkone
sehkone merged commit 5152039 into main Aug 4, 2026
5 checks passed
@sehkone
sehkone deleted the sehkone/issue-88 branch August 4, 2026 10:07
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.

Stop running CI twice on every pull request

1 participant