Skip to content

If I select the default branch (e.g., main) in CodePipeline but set the trigger filter to stage-*, which branch will the pipeline deploy—main or a stage-* branch?

0

Here, I'm using a code pipeline for the staging environment. Once the development environment is completed, a dynamic branch is created. The staging pipeline needs to use this dynamically created branch from development. When setting up the staging pipeline, I need to specify a default branch. However, at this point, the dynamic branch hasn't been created yet. So, I set the default branch to 'main' but configured the trigger to filter for branches following the 'stage-*'. My question is: which branch will the pipeline use for deployment – the default branch ('main') or the dynamically created 'stage-' branch?

asked a year ago278 views
2 Answers
2
Accepted Answer
  1. With Automatic Triggers: The pipeline will deploy the branch that matches stage-* and triggered the pipeline.
  2. With Manual Triggers: If manually triggered and no specific branch is provided, the pipeline will use the main branch by default.

Thus, in your case, when the stage-* branch is created and triggers the pipeline, the pipeline will deploy that stage-* branch, not the main branch.

AWS
EXPERT
answered a year ago
EXPERT
reviewed a year ago
0

Thanks for the update

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.