Skip to content

Commit 0e0ce0c

Browse files
committed
Skip duplicate actions when pushing in this repository
Currently when someone pushes a branch directly to pytest-localserver, we get two copies of each Github action, one for the push and one for the pull request. This change should skip the pull_request action for branches pushed directly into pytest-localserver. It won't affect branches coming from other people's forks.
1 parent 3799e04 commit 0e0ce0c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10+
# https://wildwolf.name/github-actions-how-to-avoid-running-the-same-workflow-multiple-times/
11+
if: >
12+
github.event_name != 'pull_request'
13+
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
1014
strategy:
1115
matrix:
1216
# Not all Python versions are available for linux AND x64

0 commit comments

Comments
 (0)