From e1d7419a723af5d2e1da2725f97998c14ce054d3 Mon Sep 17 00:00:00 2001 From: "claude@clouddev1" Date: Wed, 24 Jun 2026 09:28:54 +0000 Subject: [PATCH] ci: gate feature branches via pull_request only (dedupe PR-push runs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A push to a branch with an open PR fired both the `push` and `pull_request` triggers, running the gate (and manifests) twice. On Gitea those runs are byte-identical: unlike GitHub it has no merge-preview ref, so its `pull_request` checks out `refs/pull/N/head` — the same commit a branch push would. Scope `push` to `main` and let `pull_request` gate feature branches: halves CI on every PR push, loses no coverage, and is forward-compatible — if Gitea ever adds the merge ref, these runs upgrade to testing the merged result for free. --- .gitea/workflows/ci.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 45cb0a4..fa304d8 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -14,11 +14,16 @@ name: ci on: push: - # Branch pushes only — a tag push hits the same commit the branch push - # already gated, so `branches: ['**']` drops the redundant tag-triggered - # run (the release workflow owns tags). Pushing commits + a tag together - # still gates the commits via the branch push. - branches: ['**'] + # Only `main` (the post-merge gate + canonical branch). Feature branches + # are gated via `pull_request` instead. Running both on a push to a PR'd + # branch was pure duplication on Gitea: unlike GitHub it has no merge- + # preview ref — its `pull_request` checks out `refs/pull/N/head`, the same + # commit a branch push would, so the two runs were byte-identical + # (docs.gitea.com/usage/actions/faq). Gating on `pull_request` is also + # forward-compatible: if Gitea ever adds the merge ref, these runs upgrade + # to testing the merged result for free. Tags stay unmatched (release.yaml + # owns them). + branches: [main] # Skip the gate for changes that can't affect clippy/test — docs, markdown, # and the website subproject (it has its own workflow, website.yaml, that # builds + publishes it). A push touching crate code *and* these still runs