Trigger builds with Git Tags 🏷

We've recently restructured the Bitrise trigger handling and added a couple of nice features, like trigger only for pull requests and specifying source and target branch for each PR. Now we're taking it up a notch by adding tag support to triggers.

We've recently restructured the Bitrise trigger handling and added a couple of nice features, like trigger only for pull requests and specifying source and target branch for each PR.

Now we're taking it up a notch by adding tag support to triggers. This means that you can specify a pattern for your tags to trigger a specific workflow, like release or deploy-to-prod.

Why you should use tags

Tags are a good way to build and deploy your app in a specific state, e.g. v1.0.2. Previously you couldn't ensure this, because only branch patterns were available, but tags give additional granularity to your setup.

Right now you might have triggers like this with a standard GitFlow method:

trigger_map:
- push_branch: develop
 workflow: deploy-to-stage
- push_branch: master
 workflow: deploy-to-prod
- push_branch: "*"
 workflow: test
- pull_request_target_branch: "*"
 workflow: test

You can now swap out the push trigger for master to a tag trigger, which would look like this:

trigger_map:
- push_branch: develop
 workflow: deploy-to-stage
- tag: v*.*.*
 workflow: deploy-to-prod
- push_branch: "*"
 workflow: test
- pull_request_target_branch: "*"
 workflow: test

For those of you, who'd rather click than type, this can be setup easily on the shiny, new UI, in which case, you'll notice a new option and an icon for tags. Builds triggered by your tags will also show up differently on your Builds page. Neat! ✨

Update your webhook URL if it's the old bitrise.io/hooks one!

New trigger feature (like skip ci or tag based triggering) are only available if you use the new hooks.bitrise.io webhook URL!

Initially we had a non open source bitrise.io/hooks endpoint for webhooks, but every new project registered should now get the new hooks.bitrise.io webhook URL automatically.

If your webhook would still be a bitrise.io/hooks URL, please replace it with the new hooks.bitrise.io/ URL - you can find this on the Code tab of your app!

Couple of service specific notes

GitHub

You don't have to change anything to get Tag trigger support for your GitHub repository, it just works. The only thing you should be aware of is that if you git push --tags more than 3 tags at the same time GitHub will not send any tag push webhook! If you push one, two or three new tags with git push --tags GitHub will send all tags separately and will start separate builds, but if you try to push more than three tags it won't send any webhooks, and so no build will be triggered for the tags.

Bitbucket

There's nothing you would have to change if you already have a Bitbucket webhook registered for your bitrise.io app, it just works. Every tag triggers a new build, even if you push more than one new tags with git push --tags all new tags will trigger a build.

GitLab

If you previously added a webhook on GitLab and forgot to enable the Tag Push event, you'll have to delete the webhook and add it again, as GitLab doesn't have an edit feature for webhooks. If you need help with adding the webhook manually with the Tag Push event enabled, please follow this setup guide.

Visual Studio Team Services / Visual Studio Online

No webhook change required, but don't push more than one tag at a time. The webhook behaviour of VSTS is quite inconsistent if you push more than one tag with git push --tags, usually at least one tag webhook is not delieverd.

No items found.

Explore more topics

App development

Best practices from engineers on how to use Bitrise to build better apps, faster.

Community

Meet other Bitrise engineers, technology experts, power users, partners and join our BUGs.

Company

All the updates about Bitrise events, sponsorships, employees, and more.

Insights

Mobile development, latest tech, industry insights, and interviews with experts.

Mobile DevOps

Learn why mobile development is unique and requires a set of unique practices.

Releases

Stay tuned for the last updates, new features, and product improvements.

Get the latest from Bitrise

Join other Mobile DevOps engineers who receive regular emails from Bitrise, filled with tips, news, and best practices.