Skip to content

Commit b8842b5

Browse files
add instructions for how to use github repos with ADO templatized pipelines
1 parent bd87ada commit b8842b5

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Azure/Azure-Templatized-YML-Pipeline/flyway-11/deploy-build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,40 @@ trigger:
2626
include:
2727
- migrations/*
2828

29+
2930
# Move the templates to their own repository for greater control and lack of repitition across projects (DRY)
3031
# They can be included in the same repository if preferred: templates/vars.yml would work for the file below
32+
33+
# Example: if the `templates` repo is hosted on GitHub and you want Azure
34+
# DevOps to fetch it from GitHub, replace (or add) an entry like the one
35+
# below. You must first create a GitHub service connection in the Azure
36+
# DevOps project (Project Settings -> Service connections) and give it a
37+
# name (example: github-templates-conn). For a public repository you can
38+
# omit the `endpoint` field, but for private repos you must supply it.
39+
#
40+
# - repository: templates
41+
# type: github
42+
# name: <org>/<repo> # optional friendly name, e.g. myorg/templates
43+
# endpoint: github-templates-conn # service connection name in ADO
44+
# ref: refs/heads/main # optional: pin to a branch, tag or commit
45+
46+
# Azure DevOps setup steps (what to do in the UI)
47+
# Create a GitHub service connection
48+
# In Azure DevOps Project -> Project settings -> Service connections -> New service connection -> GitHub.
49+
# Choose OAuth (recommended) or Personal Access Token (PAT).
50+
# If using PAT, include repo read access.
51+
# If OAuth, sign in to GitHub and grant access to the templates repo (or org).
52+
# Give it a name, e.g., github-templates-conn.
53+
# Reference the connection in YAML
54+
# In resources.repositories add endpoint: github-templates-conn to the templates entry.
55+
# (Optional) Pin a ref
56+
# Add ref: refs/heads/main or ref: refs/tags/<tag> or ref: <commit-sha> to pin the template source version.
57+
# Permissions
58+
# Ensure the service connection has access to the target GitHub repository.
59+
# If you used a PAT, the PAT must have at least 'repo' read scope for private repos.
60+
# In Azure DevOps pipeline permissions, ensure YAML pipelines are allowed to use resources from service connections; sometimes project administrators must approve new connections for pipelines to use them.
61+
62+
3163
resources:
3264
repositories:
3365
- repository: templates

0 commit comments

Comments
 (0)