From 271d4ab1c5a8dc9a6231630d7aa01c541ed8da1f Mon Sep 17 00:00:00 2001 From: Restioson Date: Tue, 22 Oct 2024 14:09:41 +0200 Subject: [PATCH] chore(ci): don't run push & PR on PR branches This change prevents duplicate runs from occurring when opening a pull request on GitHub. Before, both the 'push' and 'pull_request' hooks would trigger, meaning that any push to a branch with an open PR would run the CI pipeline twice. By filtering the 'push' hook to 'main' and 'develop', we avoid this. --- .github/workflows/testing.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 24ebbca1..d49e1e31 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,5 +1,13 @@ name: Testing Django -on: [ pull_request, push ] # activates the workflow when there is a push or pull request in the repo + +# Activates the workflow when there is a push or pull request in the repo +on: + push: + branches: + - main + - develop + pull_request: + jobs: test_project: runs-on: ubuntu-latest # operating system your code will run on