Skip to content

Commit

Permalink
chore(ci): don't run push & PR on PR branches
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Restioson committed Oct 22, 2024
1 parent df6b43d commit 271d4ab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 271d4ab

Please sign in to comment.