Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): don't run push & PR on PR branches #133

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

Restioson
Copy link
Collaborator

@Restioson Restioson commented Oct 22, 2024

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.

The tangible benefit of this is

  1. we avoid oversubmitting GitHub CI jobs, so if we have more jobs to run in the future (see chore(ci): set up Lighthouse auditing in CI #132, which will add a new, separate lighthouse job), we get all the results quicker
  2. fixes the annoyance of having two failures/successes when it should only really be one

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.
@Restioson
Copy link
Collaborator Author

Restioson commented Oct 22, 2024

As we can see, the CI only ran once for this branch. Success :)
image

@Restioson Restioson merged commit 023fb81 into main Oct 22, 2024
1 check passed
@Restioson Restioson deleted the ci/deduplicate-runs branch October 22, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants