actions: prevent workflows triggering twice

the workflows running unconditionally for each push and each PR are run
twice when pushing to a branch that is to be merged by a PR and if that
branch is a branch local to the repo (rather than in a fork).
This commit is contained in:
Bernhard Kirchen 2024-09-23 21:53:33 +02:00
parent 82de98c7c0
commit 2265992836
3 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest
# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null
steps:
- uses: actions/checkout@v4
- name: Set up Python

View File

@ -6,6 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest
# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null
defaults:
run:
working-directory: webapp

View File

@ -6,6 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest
# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null
defaults:
run:
working-directory: webapp