If you use templates to author YAML files, then you can only specify triggers in the main YAML file for the pipeline.
How to do build your wild self update#
CI triggersĬontinuous integration (CI) triggers cause a pipeline to run whenever you push an update to the specified branches or you push specified tags. But, if you wish to access repositories in a different project, then you need to update the permissions granted to job access tokens. Normally, a pipeline has access to repositories in the same project.
How to do build your wild self code#
Git clone -c http.extraheader="AUTHORIZATION: basic " Īzure Pipelines must be granted access to your repositories to trigger their builds and fetch their code during builds. Add a script in your pipeline with the following command to clone that repo.Base64-encode this string to create a basic auth token.Get a personal access token (PAT) with Code (read) scope, and prefix it with pat:.If the access token (explained below) does not have access to the repository: To do this, select the job under the Tasks tab in the editor, select Additional Options in the right panel, and check the option to Allow scripts to access the OAuth token. In order to use System.AccessToken in a script, you must first make it available to the script. Git clone -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" If the repo is in the same project as your pipeline, or if the access token (explained below) has access to the repository in a different project, use the following command: To clone additional repositories as part of your pipeline: While creating a pipeline, to choose the repository to build, first select the project to which the repository belongs.