I want to automatically trigger a Azure Release pipeline upon adding a git tag in Github.
I tried to specify as branch on the Continuous Deployment trigger for the Artifact:
/refs/tags/*
*
but both options do not trigger a release upon creation of a git tag.
When I use *
as trigger filter and push a commit to e.g. the master
branch of my repo I am able to trigger the Release pipeline.
Am I missing something here, or is it a Azure DevOps limitation?
On GitHub.com, navigate to the main page of the repository. To the right of the list of files, click Releases. Click Draft a new release. Click Choose a tag, type a version number for your release, and press Enter.
To add tags to a new pipeline, add the --tags option to your create-pipeline command. For example, the following option creates a pipeline with two tags, an environment tag with a value of production , and an owner tag with a value of sales . Javascript is disabled or is unavailable in your browser.
To trigger a pipeline upon the completion of another pipeline, configure a pipeline resource trigger. The following example configures a pipeline resource trigger so that a pipeline named app-ci runs after any run of the security-lib-ci pipeline completes. This example has the following two pipelines.
One approach could be to use the Azure/pipelines GitHub Action to trigger the Azure Pipeline.
The actions to support this were announced in the Azure DevOps Sprint 161 release notes
An example is available on GitHub, the interesting bit is this:
deploy-using-azure-pipelines:
runs-on: ubuntu-latest
steps:
- name: 'Trigger an Azure Pipeline to deploy the app to PRODUCTION'
uses: Azure/pipelines@releases/v1
with:
azure-devops-project-url: 'https://dev.azure.com/OrganizationName/ProjectName'
azure-pipeline-name: 'WebApp_Azure_Prod'
azure-devops-token: '${{ secrets.AZURE_DEVOPS_TOKEN }}'
You would need to change the URL and create a secret named AZURE_DEVOPS_TOKEN
in the GitHub project that has an Azure DevOps personal access token.
The trigger for your GitHub Action workflow could use something similar to the answers in Trigger Github Action only on new tags?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With