Prevent duplicate workflows after opening PRs. Currently we run one for push and pull_request events, which although technically different (since PRs use the pending merge commit vs branch head), that's not relevant as far as I know. We compare the base and head repo to ensure PRs from forks still run the checks (since those won't trigger a push event).
Pull Request doc
Purpose
Prevent duplicate workflows after opening PRs. Currently we run one for
push
andpull_request
events, which although technically different (since PRs use the pending merge commit vs branch head), that's not relevant as far as I know. We compare the base and head repo to ensure PRs from forks still run the checks (since those won't trigger apush
event).What the code is doing
Add condition to jobs which should prevent duplicates. Copy pasted from https://github.com/zopefoundation/meta/issues/145
Also removed the
skip_ci
feature since this is kinda builtin now: see https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runsTesting
Some testing here, although that doesn't test the forked repo scenario: https://github.com/jenhagg/test-ci/pull/6
Time estimate
5 min