I have an iOS app that uses Xcode Cloud as its CI system. I have a workflow configured so that whenever any branch is updated, Xcode Cloud runs the Test and Archive actions and pushes the resulting binary to TestFlight.
I don’t actually need or want TestFlight builds for every branch update. I would prefer to run the Archive and TestFlight steps only when the branch being updated is the develop
branch or one whose name starts with release/
. Is there a way to examine the branch name as the workflow is running and decide then whether to run an Archive step after the Test step? You can write your own shell scripts to be executed as the workflow proceeds, but it seems like the only way they can affect which steps are run is to mark the build as failed, which I don’t want to do.
I could define multiple workflows in Xcode Cloud, put the Archive step in just one of them, and configure that workflow to run only on certain branches. The problem is that the other workflow would still run, because Xcode Cloud doesn’t have a way of saying, “this workflow should run for all branches that don’t match the given pattern.”