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.
The Mobile DevOps Newsletter

Explore more topics

App Development

Learn how to optimize your mobile app deployment processes for iOS, Android, Flutter, ReactNative, and more

Bitrise & Community

Check out the latest from Bitrise and the community. Learn about the upcoming mobile events, employee spotlights, women in tech, and more

Bitrise Insights

Cache | Caching

Mobile App Releases

Learn how to release faster, better apps on the App Store, Google Play Store, Huawei AppGallery, and other app stores

Mobile DevOps

Learn Mobile DevOps best practices such as DevOps for iOS, Android, and industry-specific DevOps tips for mobile engineers

Mobile Testing & Security

Learn how to optimize mobile testing and security — from automated security checks to robust mobile testing and more.

Product Updates

Check out the latest product updates from Bitrise — Build Insights updates, product news, and more.

The Mobile DevOps Newsletter

Join 1000s of your peers. Sign up to receive Mobile DevOps tips, news, and best practice guides once every two weeks.