Skip to content

Commit b749ebf

Browse files
committed
github: Prevent Actions running twice in PRs
This is seems to be a common[1] issue[2] and there really is not a very satisfactory solution other than adding an "if" on the job rather than on the top-level workflow. Of course, there were other solutions listed, but they'd involve managing a hardcoded list of branch names where the "on push" action is triggered. So I went for the workaround listed in [1], which adds an if to the job specification. [1]: zopefoundation/meta#145 [2]: open-telemetry/opentelemetry-python#1370 Signed-off-by: aszlig <aszlig@nix.build>
1 parent d862add commit b749ebf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on: [push, pull_request]
44
jobs:
55
linux:
66
runs-on: ubuntu-latest
7+
if: github.event_name != 'pull_request' ||
8+
github.event.pull_request.head.repo.full_name !=
9+
github.event.pull_request.base.repo.full_name
710
steps:
811
- uses: actions/checkout@v2
912
- uses: actions/setup-python@v1

0 commit comments

Comments
 (0)