Automated validation of PR governance attestation checklists using the Agent Governance Toolkit.
Ensures PRs contain properly filled governance attestations with exactly one checkbox marked per required section.
- uses: microsoft/agent-governance-toolkit/action/governance-attestation@v2This validates the current PR's description against the standard 7-section governance attestation.
- name: Governance Attestation
uses: microsoft/agent-governance-toolkit/action/governance-attestation@v2- name: Governance Attestation
uses: microsoft/agent-governance-toolkit/action/governance-attestation@v2
with:
required-sections: |
Security review
Privacy review
CELA review- name: Governance Attestation
uses: microsoft/agent-governance-toolkit/action/governance-attestation@v2
with:
pr-body: ${{ github.event.pull_request.body }}| Input | Description | Required | Default |
|---|---|---|---|
pr-body |
PR body text to validate | No | (current PR from context) |
required-sections |
YAML list of section titles (one per line) | No | Standard 7 sections |
min-body-length |
Minimum PR body length | No | 40 |
python-version |
Python version to use | No | 3.12 |
toolkit-version |
Toolkit version to install | No | (latest) |
| Output | Description |
|---|---|
status |
pass or fail |
errors |
Newline-separated list of errors |
sections-found |
JSON mapping sections to checkbox counts |
message |
Formatted validation message |
- Security review
- Privacy review
- CELA review
- Responsible AI review
- Accessibility review
- Release Readiness / Safe Deployment
- Org-specific Launch Gates
Each section must have exactly one checkbox marked:
- ✅
[x] Yes - ✅
[x] No - ✅
[x] Not needed (explain below)
Your .github/pull_request_template.md should follow this structure:
GitHub Issue Forms compatibility: GitHub Issue Forms with
type: checkboxesautomatically render checkbox group labels as###(h3) headings. Both##(h2) and###(h3) heading levels are accepted, so Issue Form–generated bodies and hand-written PR templates work without any extra configuration.
# Governance Attestations (required)
## 1) Security review
- [ ] ✅ Yes
- [ ] ❌ No
- [ ] ⚠️ Not needed (explain below)
## 2) Privacy review
- [ ] ✅ Yes
- [ ] ❌ No
- [ ] ⚠️ Not needed (explain below)
<!-- ... more sections ... -->
---
# Notes / Links
Provide justifications for N/A selections:
- name: Governance Attestation
on:
pull_request:
types: [opened, edited, reopened, synchronize]
permissions:
pull-requests: read
jobs:
verify-attestation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify PR governance attestation
uses: microsoft/agent-governance-toolkit/action/governance-attestation@v2
id: attestation
- name: Comment on PR (on failure)
if: failure()
uses: actions/github-script@v7
with:
script: |
const errors = `${{ steps.attestation.outputs.errors }}`.split('\n');
const body = `❌ **Governance attestation validation failed:**\n\n${errors.map(e => `- ${e}`).join('\n')}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});## 1) Security review
- [ ] ✅ Yes
- [x] ⚠️ Not needed (explain below)
- [ ] ❌ NoExactly one checkbox marked.
No checkbox marked:
## 1) Security review
- [ ] ✅ Yes
- [ ] ⚠️ Not needed (explain below)
- [ ] ❌ NoMultiple checkboxes marked:
## 1) Security review
- [x] ✅ Yes
- [x] ⚠️ Not needed (explain below)
- [ ] ❌ NoSection missing:
# Governance Attestations
(Security review section not found)| Error | Meaning | Fix |
|---|---|---|
Missing section: "X" |
Required section not found | Add section to PR description |
Section "X" must have exactly ONE checked box, found 0 |
No checkbox marked | Mark exactly one checkbox |
Section "X" must have exactly ONE checked box, found 2 |
Multiple checkboxes marked | Uncheck all but one |
PR description is too short |
Template not used | Use governance attestation template |
Override default sections for your organization:
- uses: microsoft/agent-governance-toolkit/action/governance-attestation@v2
with:
required-sections: |
Security review
Privacy review
Legal review
Compliance review
Architecture review
Product reviewUse continue-on-error to treat failures as warnings:
- name: Governance Attestation
uses: microsoft/agent-governance-toolkit/action/governance-attestation@v2
continue-on-error: trueMIT License - see LICENSE for details.