Skip to content

ci: run CI on push to main only - #83

Merged
glebedel merged 1 commit into
mainfrom
ci/push-ci-main-only
Nov 20, 2026
Merged

glebedel merged 1 commit into
mainfrom
ci/push-ci-main-only

Conversation

@glebedel

@glebedel glebedel commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

CI ran twice for every commit on a feature branch with an open PR: once for push and once for pull_request. This limits the push trigger to main. PRs into main keep their run, and main keeps its post-merge run.

Before and after (2026-11-12 to 2026-11-19, billed minutes per job, rounded up)

CI runs Runs Runner minutes
push to a feature branch (removed by this PR) 28 216
pull_request into main (unchanged) 28 202
push to main (unchanged) 12 89

That is about 31 runner minutes a day on ubuntu-latest. The repo is public, so this frees concurrent runner slots and removes duplicate status checks rather than cutting a bill.

Verification

  • actionlint clean.
  • Branch rules on main require no status checks, so no required check changes name or stops reporting.
  • The push of this branch started no CI push run; the PR run is the only one.

Risk

A branch with no PR into main no longer gets CI on push. Opening a PR (draft included) runs it.

No runtime change, no demo.

Requested by guillaume@stackone.com

🤖 Generated with Claude Code


Summary by cubic

Limits the CI push trigger to main so feature branches stop running the full CI twice per commit (once for push, once for pull_request).

  • Removes duplicate runner workload: 28 feature-branch push runs consumed 216 of 526 runner minutes in the week of 2026-11-12.
  • Branches without a PR into main no longer get CI on push; opening a PR (draft included) runs it.
  • No required status checks are affected, since branch rules on main require none.

Written for commit 9ed6b84. Summary will update on new commits.

View guided diff Turn on auto-fix

Feature branches already get a pull_request run on the same commit, so the
push run repeated the whole lint, test matrix and build. Over 2026-11-12 to
2026-11-19, 28 feature-branch push runs used 216 of 526 runner minutes.

Requested by guillaume@stackone.com

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
@glebedel glebedel self-assigned this Nov 19, 2026
@glebedel
glebedel merged commit 4153ad8 into main Nov 20, 2026
9 checks passed
@glebedel
glebedel deleted the ci/push-ci-main-only branch November 20, 2026 17:17
@glebedel

Copy link
Copy Markdown
Contributor Author

Automated post-merge check by s2d2 for guillaume@stackone.com

Verdict: no signal yet (partial). Merged at 17:17:56Z as 4153ad8.

  • CI ran on the push to main for the merge commit and passed, so main still gets its post-merge run.
  • No feature-branch push or PR has happened since the merge, so I can't confirm yet that feature-branch pushes skip CI. Before merging, pushing this PR's own branch started 0 CI push runs, which is the expected behaviour.

I'll check again in about 24 hours.

@glebedel

Copy link
Copy Markdown
Contributor Author

Automated post-merge check by s2d2 for guillaume@stackone.com (second look, 2026-11-21 17:30 UTC)

Verdict: no signal yet. Nothing has regressed.

  • Since the merge (4153ad8), CI has run only once, the push to main at 2026-11-20T17:17:59Z, and it succeeded.
  • No branch has been pushed and no PR has opened since then, so the dedupe (a feature-branch push starting no push CI run) has not been tested yet.

There will be one more look by 2026-11-27. If nothing triggers it before then, it will be reported as "never observed".

@glebedel

Copy link
Copy Markdown
Contributor Author

Automated post-merge check by s2d2 for guillaume@stackone.com (final look, 2026-11-27 17:00 UTC)

Verdict: never observed. No regression.

  • Between the merge (4153ad8, 2026-11-20) and now, CI ran once: the push to main at 2026-11-20T17:17:59Z, run 44781936018, which succeeded.
  • In that time no branch other than main was pushed. The 4 other branches were last pushed between March and October 2026. No PR was opened or updated after this one.
  • So the dedupe (a feature-branch push no longer starting its own CI run next to the pull_request run) never got the traffic to show it working. It will show on the next PR. Nothing broke.

This is the last automated look at this PR.

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.

2 participants