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 GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
check-pull-requestCheck the pull request for AB#xxx (scope configurable via pull-request-check-scope)yesfalse
pull-request-check-scopeOnly if check-pull-request=true, where to look for AB# in the pull request. Options: title-or-body, body-only, title-onlynotitle-or-body
check-commitsCheck each commit in the pull request for AB#xxxyestrue
fail-if-missing-workitem-commit-linkOnly if check-commits=true, fail the action if a commit in the pull request is missing AB# in every commit messagenotrue
link-commits-to-pull-requestOnly if check-commits=true, link the work items found in commits to the pull requestnotrue
azure-devops-tokenAzure 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-branchno
azure-devops-organizationThe 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-branchno
github-tokenThe GitHub token that has `contents: read` and `pull-requests: write` accessyes${{ github.token }}
comment-on-failureComment on the pull request if the action failsyestrue
validate-work-item-existsValidate 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.notrue
add-work-item-tableAdd 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.nofalse
add-work-item-from-branchAutomatically 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.nofalse
branch-work-item-prefixesComma-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.notask, bug, bugfix
branch-work-item-min-digitsMinimum 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.no5

no outputs