Skip to content

Commit b39c5f5

Browse files
committed
ci: avoid duplicate workflow run on pull requests from the local repo
1 parent 1acb175 commit b39c5f5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
jobs:
1313
test-java:
1414
runs-on: ubuntu-latest
15+
#avoids duplicate execution of pr from local repo, but allows pr from forked repos and dependabot
16+
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/')))
1517
defaults:
1618
run:
1719
working-directory: java
@@ -48,6 +50,8 @@ jobs:
4850
java/target/tmp*/*.html
4951
test-net:
5052
runs-on: ubuntu-latest
53+
#avoids duplicate execution of pr from local repo, but allows pr from forked repos and dependabot
54+
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/')))
5155
defaults:
5256
run:
5357
working-directory: net

0 commit comments

Comments
 (0)