joshjohanning/Azure DevOps Commit Validator and Pull Request Linker
Enforce that each commit in a pull request has AB# in the commit message and link all of the work items to the pull request
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| check-pull-request | Check the pull request for AB#xxx (scope configurable via pull-request-check-scope) | yes | false |
| pull-request-check-scope | Only if check-pull-request=true, where to look for AB# in the pull request. Options: title-or-body, body-only, title-only | no | title-or-body |
| check-commits | Check each commit in the pull request for AB#xxx | yes | true |
| fail-if-missing-workitem-commit-link | Only if check-commits=true, fail the action if a commit in the pull request is missing AB# in every commit message | no | true |
| link-commits-to-pull-request | Only if check-commits=true, link the work items found in commits to the pull request | no | true |
| azure-devops-token | Azure DevOps Personal Access Token (needs to be a full PAT). Required when any of these are enabled: link-commits-to-pull-request, validate-work-item-exists, add-work-item-table, or add-work-item-from-branch | no | — |
| azure-devops-organization | The name of the Azure DevOps organization. Required when any of these are enabled: link-commits-to-pull-request, validate-work-item-exists, add-work-item-table, or add-work-item-from-branch | no | — |
| github-token | The GitHub token that has `contents: read` and `pull-requests: write` access | yes | ${{ github.token }} |
| comment-on-failure | Comment on the pull request if the action fails | yes | true |
| validate-work-item-exists | Validate that the work item(s) referenced in commits and PR exist in Azure DevOps. Requires azure-devops-token and azure-devops-organization to be set. | no | true |
| add-work-item-table | Add a Linked Work Items table to the PR body showing titles for AB#xxx references (original AB# references are preserved). Requires azure-devops-token and azure-devops-organization to be set. | no | false |
| add-work-item-from-branch | Automatically extract work item ID(s) from the head branch name and add AB#xxx to the PR body if not already present (e.g. branch task/12345/fix-bug adds AB#12345 to the PR body). Only numbers following one of the configured branch-work-item-prefixes keywords are extracted. Each extracted ID is always validated against Azure DevOps before being added regardless of the validate-work-item-exists setting. Requires azure-devops-token and azure-devops-organization to be set. | no | false |
| branch-work-item-prefixes | Comma-separated list of keyword prefixes used to identify work item IDs in branch names (e.g. task/12345). Only numbers following one of these keywords (separated by /, -, or _) are extracted. Only used when add-work-item-from-branch is true. | no | task, bug, bugfix |
| branch-work-item-min-digits | Minimum number of digits for a work item ID extracted from a branch name. Set to 1 to match any length. Only used when add-work-item-from-branch is true. | no | 5 |
Outputs
no outputs