I am confused why the following 2 things happen:
- When I push some commits to my
feature_foo
branch, 2 workflows (builds) are run: the primary workflow against the latest commit, and deploy workflow against my last PR, both onfeature_foo
. I expected only the primary workflow to be run as I haven't issued a PR yet - 2 identical email notifications are sent to me from
artifacts+\<my-bitrise-project-id\>@bitrise.io
within the same minute. I understand that a PR can lead to two builds (as a PR is technically a push), but doubt that is the issue here as I've not created a PR yet.
Here is my current bitrise.yml trigger map:
trigger_map:
- push_branch: "*"
workflow: primary
- pull_request_source_branch: "*"
pull_request_target_branch: feature
workflow: deployment-staging
- tag: "v*.*.*"
workflow: deployment-production
By the way, this is my desired 3-workflow setup:
- Run integration tests (primary workflow) on 2 occasions:
- Code push to * (any branch)
- Pull requests to
feature
branch (when the PR is created i.e. pre-merged state so contributors can preview the potential effect of their proposed changes)
- Run deployment (deploy workflow) to staging when PRs from * to
feature
branch are merged - Run deployment (deploy workflow) to production when tags
v*.*.*
are pushed
What is the correct bitrise.yml config to achieve this? The docs do not indicate how we can differentiate PRs by state (issued vs merged). I want to deploy only after the code has been reviewed.
Thanks