From fff25ce3754216ae56188258a795c2395624acf1 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Wed, 14 Oct 2026 02:53:30 -0500 Subject: [PATCH] test each change once, not on both its push and its pull request A branch push and its pull request ran the same tests on two runners. Now pushes are tested only on main, where the run also publishes, and everything else through its pull request, whose check is the one branch protection requires. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01D31MsLkM9DkCauP1EB2zgw --- .forgejo/workflows/test.yaml | 6 ++++++ CONTRIBUTING.md | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml index df39979..a24b1a8 100644 --- a/.forgejo/workflows/test.yaml +++ b/.forgejo/workflows/test.yaml @@ -3,8 +3,14 @@ name: test +# A change is tested once: as a pull request while it is one, and on main +# after it merges, which is also what publishes the source. A branch push is +# not tested on its own, since it would only repeat its pull request's run on +# another runner; nothing reaches main except through a pull request. on: push: + branches: + - main pull_request: workflow_dispatch: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2dd9897..c1b1ea2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,8 +125,9 @@ validates them, and against the rules here: the identifier is version, and the files agree. The installers of the versions changed since `origin/main` must download from git.jcollie.dev and hash to the SHA-256 their manifest gives, so those are downloaded; without `--changed-since` every -version's installers are. CI runs the same check on every push and pull -request. +version's installers are. CI runs the same check on every pull request, and +on `main` once it merges; a branch is checked through its pull request rather +than on each push, so that a change is not tested twice. `main` only moves through a merged pull request that has passed validation. Branch protection enforces it for everyone, the repository's owner included: -- knotmirror 0.0.1