Skip to content

Bump Azure.Identity and 17 others #24

Bump Azure.Identity and 17 others

Bump Azure.Identity and 17 others #24

name: Coding-Agent PR Gate
on:
pull_request:
types: [opened, edited, reopened, ready_for_review, labeled, unlabeled]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checklist-gate:
name: PR body checklist gate
if: >-
github.event.pull_request.draft == false &&
(
contains(github.event.pull_request.labels.*.name, 'coding-agent') ||
github.event.pull_request.user.login == 'Copilot' ||
github.actor == 'copilot-swe-agent[bot]'
)
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- name: Verify every Agent attestation checkbox is ticked
uses: actions/github-script@v7
with:
script: |
const body = context.payload.pull_request.body || '';
// Strip HTML comments — guidance comments may contain unticked example boxes.
// Then strip fenced code blocks — pasted command output must not trip the gate.
const stripped = body
.replace(/<!--[\s\S]*?-->/g, '')
.replace(/```[\s\S]*?```/g, '');
// The gate only scans the `## Agent attestation` section. Other sections
// (Type of change, Required reading consulted) intentionally allow partial
// ticking — only the attestation checkboxes are gating.
const sectionMatch = stripped.match(/^##\s+Agent attestation\s*$([\s\S]*?)(?=^##\s|\z)/m);
if (!sectionMatch) {
core.setFailed(
`PR body is missing the '## Agent attestation' section. ` +
`Coding-agent PRs must include the attestation block from PULL_REQUEST_TEMPLATE.md.`
);
return;
}
const lines = sectionMatch[1].split(/\r?\n/);
const unchecked = [];
for (let i = 0; i < lines.length; i++) {
const m = lines[i].match(/^\s*[-*]\s+\[\s\]\s+(.*)$/);
if (m) {
unchecked.push(m[1]);
}
}
if (unchecked.length > 0) {
core.setFailed(
`Agent attestation has ${unchecked.length} unticked checkbox(es). ` +
`Coding-agent PRs require every attestation box to be ticked before merge.\n\n` +
unchecked.map(u => ` - ${u}`).join('\n') +
`\n\nTick each box in the '## Agent attestation' section. If this PR was not produced by an agent, remove the 'coding-agent' label (the gate also fires automatically for the Copilot bot author).`
);
return;
}
core.info('All Agent attestation checkboxes are ticked. Gate passes.');