Create an autolink reference for a repository
Input Schema
| Property | Type | Description | Required |
|---|---|---|---|
| token | string | The token to use for authorization to GitHub | |
| repoUrl | string | Accepts the format `github.com?repo=reponame&owner=owner` where `reponame` is the new repository name and `owner` is an organization or username | |
| keyPrefix | string | This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. | |
| urlTemplate | string | The URL must contain `<num>` for the reference number. `<num>` matches different characters depending on the value of isAlphanumeric. | |
| isAlphanumeric | boolean | Whether this autolink reference matches alphanumeric characters. If `true`, the `<num>` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If `false`, this autolink reference only matches numeric characters. Default: `true` |
Output Schema
Usage Examples
Add Jira autolinks for issue keys after repository creation
Creates an autolink so references like SVC-123 link to the corresponding Jira issue. Run this after fetch:template and publish:github.
steps:
- id: fetch-skeleton
action: fetch:template
input:
url: ./skeleton
values:
name: ${{ parameters.name }}
owner: ${{ parameters.owner }}
- id: publish
action: publish:github
input:
repoUrl: ${{ parameters.repoUrl }}
- id: autolink-jira
action: github:autolinks:create
input:
repoUrl: ${{ parameters.repoUrl }}
keyPrefix: "SVC-"
urlTemplate: "https://acme.atlassian.net/browse/SVC-<num>"
isAlphanumeric: falseLink RFC references to internal documentation
Creates an autolink so RFC-42 style references link to your internal RFC portal. Use this when you want lightweight cross linking of design docs after publish:github.
steps:
- id: fetch
action: fetch:template
input:
url: ./skeleton
values:
name: ${{ parameters.name }}
- id: publish
action: publish:github
input:
repoUrl: ${{ parameters.repoUrl }}
- id: autolink-rfc
action: github:autolinks:create
input:
repoUrl: ${{ parameters.repoUrl }}
keyPrefix: "RFC-"
urlTemplate: "https://docs.acme.internal/rfcs/<num>"Configure Azure Boards autolinks using a dedicated GitHub token
Creates an autolink so AB#123 references open the corresponding Azure Boards work item. Provide a token when the default GitHub App credentials are not sufficient.
steps:
- id: fetch
action: fetch:template
input:
url: ./skeleton
values:
name: ${{ parameters.name }}
owner: ${{ parameters.owner }}
- id: publish
action: publish:github
input:
repoUrl: ${{ parameters.repoUrl }}
- id: autolink-azure-boards
action: github:autolinks:create
input:
repoUrl: ${{ parameters.repoUrl }}
keyPrefix: "AB#"
urlTemplate: "https://dev.azure.com/acme/engineering/_workitems/edit/<num>"
isAlphanumeric: false
token: ${{ parameters.githubToken }}Add multiple autolinks for Sentry issues and runbooks
Creates two autolinks so SENTRY-100 and RUN-200 link to Sentry issues and internal runbooks. Use this to set up several patterns for the same repository in one workflow.
steps:
- id: fetch
action: fetch:template
input:
url: ./skeleton
values:
name: ${{ parameters.name }}
- id: publish
action: publish:github
input:
repoUrl: ${{ parameters.repoUrl }}
- id: autolink-sentry
action: github:autolinks:create
input:
repoUrl: ${{ parameters.repoUrl }}
keyPrefix: "SENTRY-"
urlTemplate: "https://sentry.io/organizations/acme/issues/<num>"
isAlphanumeric: false
- id: autolink-runbooks
action: github:autolinks:create
input:
repoUrl: ${{ parameters.repoUrl }}
keyPrefix: "RUN-"
urlTemplate: "https://runbooks.acme.internal/RUN-<num>"
isAlphanumeric: falseMatch alphanumeric design spec IDs
Creates an autolink for DESIGN-AB-123 references where the suffix can include letters, digits, and dashes. Explicitly enables alphanumeric matching for mixed ID formats.
steps:
- id: fetch
action: fetch:template
input:
url: ./skeleton
values:
name: ${{ parameters.name }}
owner: ${{ parameters.owner }}
- id: publish
action: publish:github
input:
repoUrl: ${{ parameters.repoUrl }}
- id: autolink-design-specs
action: github:autolinks:create
input:
repoUrl: ${{ parameters.repoUrl }}
keyPrefix: "DESIGN-"
urlTemplate: "https://design.acme.internal/specs/<num>"
isAlphanumeric: true