5252 PYTHONIOENCODING
5353 PYTHONLEGACYWINDOWSSTDIO
5454 PYTHONUTF8
55- UPSTREAM_REPOSITORY_ID : >-
56- 69382485
55+ UPSTREAM_REPOSITORY_ID : 69382485 # Repo ID of antonbabenko/pre-commit-terraform
5756
5857run-name : >-
5958 ${{
@@ -255,6 +254,13 @@ jobs:
255254 name : 📦 ${{ needs.pre-setup.outputs.git-tag }}
256255 needs :
257256 - pre-setup
257+ # Prevent run 'push' events for the branches in upstream repository as it
258+ # already covered by 'pull_request' event
259+ if : >-
260+ github.repository_id != needs.pre-setup.outputs.upstream-repository-id
261+ || github.event_name != 'push'
262+ || github.ref_name == github.event.repository.default_branch
263+
258264
259265 runs-on : ubuntu-latest
260266
@@ -502,6 +508,12 @@ jobs:
502508 codecov-token : ${{ secrets.CODECOV_TOKEN }}
503509
504510 check : # This job does nothing and is only used for the branch protection
511+
512+ # Separate 'pull_request' check from other checks to avoid confusion in
513+ # GitHub branch protection about which check is required when multiple
514+ # events trigger this workflow.
515+ name : >-
516+ ${{ github.event_name == 'push' && 'check​' || 'check' }}
505517 if : always()
506518
507519 needs :
@@ -517,3 +529,15 @@ jobs:
517529 uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
518530 with :
519531 jobs : ${{ toJSON(needs) }}
532+ # Needed to not fail on skipped 'push' events for the branches in
533+ # upstream repository as they already covered by 'pull_request' event
534+ allowed-skips : >-
535+ ${{
536+ (
537+ github.repository_id != needs.pre-setup.outputs.upstream-repository-id
538+ || github.event_name != 'push'
539+ || github.ref_name == github.event.repository.default_branch
540+ )
541+ && 'lint, tests'
542+ || ''
543+ }}
0 commit comments