Duplicated CI runs? #483

Closed
opened 2026-06-06 15:05:02 +00:00 by guettli · 2 comments
guettli commented 2026-06-06 15:05:02 +00:00 (Migrated from codeberg.org)

I see duplicated CI runs?

https://codeberg.org/guettli/sharedinbox/actions

Why?

How to fix?

I see duplicated CI runs? https://codeberg.org/guettli/sharedinbox/actions Why? How to fix?
guettlibot commented 2026-06-06 15:10:04 +00:00 (Migrated from codeberg.org)

The root cause is clear. Here's the plan:


Root cause: .forgejo/workflows/ci.yml line 2 uses on: [push, pull_request]. When a commit is pushed to a feature branch that has an open pull request, Forgejo fires both a push event and a pull_request event — resulting in two identical CI runs for every PR update.

Fix: Scope the push trigger to the main branch only. PRs will still trigger via pull_request; direct pushes to main (merges) will trigger via push. The two events will never fire together for the same commit.

Change required.forgejo/workflows/ci.yml:

# Before
on: [push, pull_request]

# After
on:
  push:
    branches:
      - main
  pull_request:

That one change eliminates the duplicate. No other workflow files are affected:

  • deploy.yml and chaos-monkey.yml use schedule/workflow_dispatch only — no duplicate risk.
  • website.yml already correctly scopes its push trigger to branches: [main].
  • renovate.yml, windows-nightly.yml, firebase-tests.yml would need to be checked for the same pattern, but ci.yml is the reported source.
The root cause is clear. Here's the plan: --- **Root cause**: `.forgejo/workflows/ci.yml` line 2 uses `on: [push, pull_request]`. When a commit is pushed to a feature branch that has an open pull request, Forgejo fires **both** a `push` event and a `pull_request` event — resulting in two identical CI runs for every PR update. **Fix**: Scope the `push` trigger to the `main` branch only. PRs will still trigger via `pull_request`; direct pushes to `main` (merges) will trigger via `push`. The two events will never fire together for the same commit. **Change required** — `.forgejo/workflows/ci.yml`: ```yaml # Before on: [push, pull_request] # After on: push: branches: - main pull_request: ``` That one change eliminates the duplicate. No other workflow files are affected: - `deploy.yml` and `chaos-monkey.yml` use `schedule`/`workflow_dispatch` only — no duplicate risk. - `website.yml` already correctly scopes its `push` trigger to `branches: [main]`. - `renovate.yml`, `windows-nightly.yml`, `firebase-tests.yml` would need to be checked for the same pattern, but `ci.yml` is the reported source.
guettlibot commented 2026-06-06 15:40:04 +00:00 (Migrated from codeberg.org)

Fixed and PR opened: https://codeberg.org/guettli/sharedinbox/pulls/490

What changed: .forgejo/workflows/ci.yml previously used on: [push, pull_request], which fires two CI runs for every commit pushed to a feature branch with an open PR — one for the push event and one for the pull_request event. Scoping the push trigger to branches: [main] means feature-branch commits only trigger via pull_request, while direct pushes to main (merge commits) still trigger via push.

Fixed and PR opened: https://codeberg.org/guettli/sharedinbox/pulls/490 **What changed**: `.forgejo/workflows/ci.yml` previously used `on: [push, pull_request]`, which fires two CI runs for every commit pushed to a feature branch with an open PR — one for the `push` event and one for the `pull_request` event. Scoping the `push` trigger to `branches: [main]` means feature-branch commits only trigger via `pull_request`, while direct pushes to `main` (merge commits) still trigger via `push`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#483