Skip to content

Commit 11067ac

Browse files
cuioss-oliverclaude
andcommitted
fix(workflows): use conditional job execution to prevent duplicate runs
Replace concurrency-based duplicate prevention with conditional job execution that properly handles both internal and fork PRs. The condition checks if it's a push event OR a PR from a fork, preventing duplicate runs while still supporting external contributors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c46da21 commit 11067ac

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

.github/workflows/maven.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@ on:
66
pull_request:
77
branches: [main]
88

9-
# Prevent duplicate runs when pushing to a PR branch
10-
# The second run (usually pull_request) cancels the first (push)
11-
concurrency:
12-
group: ${{ github.workflow }}-${{ github.ref }}
13-
cancel-in-progress: true
14-
159
jobs:
1610
build:
17-
11+
# Run on push events, OR on pull_request only if from a fork
12+
# This prevents duplicate runs: push handles internal branches, PR handles forks
13+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
1814
runs-on: ubuntu-latest
1915
strategy:
2016
matrix:

0 commit comments

Comments
 (0)