Hello @JB Johnson ,
Your pipeline runs twice because:
- The
trigger
section starts a CI pipeline when code is pushed. - The
pr
section starts the PR_automated pipeline for pull requests.
When you create a PR, a push to the source branch (e.g., dev-remote
) triggers the CI pipeline, and the PR event triggers the PR_automated pipeline, causing both to run.
To prevent the individual CI pipeline from running on PR-related pushes, you need to add an exclude
list to the trigger
section. This will ensure that certain branches, such as dev-remote
, do not trigger the pipeline separately
Updated YAML file:
trigger:
branches:
include:
- AMPTK_DEVELOPMENT_MASTER
- AMPTK_STAGING_MASTER
- AMPTK_PRODUCTION_MASTER
exclude:
- dev-remote # Exclude the source branch used for PRs
- feature/* # Optionally exclude feature branches
- bugfix/* # Optionally exclude bugfix branches
pr:
branches:
include:
- AMPTK_DEVELOPMENT_MASTER
- AMPTK_STAGING_MASTER
- AMPTK_PRODUCTION_MASTER
Update the YAML file with the changes, save and push it to your repository, then create a test pull request to verify that only the PR_automated pipeline runs.
Hope this helps!
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.