Skip to content

Fix: Remove duplicate CI runs by removing pull_request trigger (fixes #133)#134

Merged
wkoszek merged 1 commit into
mainfrom
issue/133
Nov 25, 2025
Merged

Fix: Remove duplicate CI runs by removing pull_request trigger (fixes #133)#134
wkoszek merged 1 commit into
mainfrom
issue/133

Conversation

@wkoszek

@wkoszek wkoszek commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Summary

Remove pull_request trigger from build workflow to prevent duplicate CI runs. CI was running twice for PR pushes (once for push, once for pull_request event).

Problem

When pushing to a PR branch:

  1. Push event triggers build workflow ✅
  2. Pull request event also triggers build workflow ❌ (duplicate)

Result: Same commit tested twice, wasting CI resources

Solution

Remove pull_request trigger, keep only push trigger for all branches.

Behavior After Fix

  • Branch push: CI runs once ✅
  • PR creation: No additional run (already ran on push) ✅
  • PR update: No additional run (already ran on push) ✅
  • Merge to main: CI runs once, creates release if feat/fix commits ✅
  • Manual trigger: Still works via workflow_dispatch ✅

Changes

  • Remove pull_request: from workflow triggers
  • Keep push: branches: ['**'] for all branches
  • Keep workflow_dispatch: for manual runs
  • Release steps remain conditional on github.ref == 'refs/heads/main'

Fixes #133

…133)

CI was triggering twice for PR pushes - once for push event and once
for pull_request event. Remove pull_request trigger to run CI exactly
once per push.

The release logic is already conditional on main branch, so it will:
- Run build/test on all branch pushes
- Only create releases when pushed to main with feat/fix commits

Changes:
- Remove pull_request trigger from build.yml
- Keep push trigger for all branches
- Keep workflow_dispatch for manual runs
- Release steps remain conditional on main branch
@claude

claude Bot commented Nov 25, 2025

Copy link
Copy Markdown

Correct approach. Removing pull_request trigger eliminates duplicate CI runs.

Verify: Check that PR checks still display correctly on GitHub. Some repos need pull_request for check status reporting on PR pages, but with push on all branches ('**'), checks should still appear since they run on the PR's head branch.

Edge case: External forks won't trigger CI on push (they can't push to your repo). If you accept external contributions, you'll need pull_request_target with appropriate safety controls. If not accepting external PRs, this is fine.

Ship it.

@wkoszek
wkoszek merged commit 9c48cd9 into main Nov 25, 2025
2 checks passed
@wkoszek
wkoszek deleted the issue/133 branch November 25, 2025 05:04
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.

Fix CI to trigger once per push and enable release on merge

1 participant