Documentation
¶
Overview ¶
Command issueguard decides whether a new or edited issue, or issue comment, holds what looks like a key (Story 4.14). The issue-guard workflow runs it on the `issues` and `issue_comment` events and, when it says so, adds the possible-secret label and posts the fixed rotation comment.
It reads the event payload (-event, default $GITHUB_EVENT_PATH), takes the comment body for a comment event and the issue title and body otherwise, and pipes it to `<tokenhound> scan - --no-verify --include-test-keys --format json --quiet`, run in an empty directory so no project config or ignore file applies. Generated test keys (AD-16) count: a key-shaped value in a public issue is flagged whatever it is. Suppressed findings count too, so an inline `tokenhound:allow` pasted with a key does not hide it. Comments on pull requests arrive as issue_comment events and are scanned like any other comment.
The body, the scan output and every finding (redacted form included) stay inside this process: it prints only the decision and the issue number, and writes `possible-secret=true|false` and `number=<n>` to $GITHUB_OUTPUT when set. With -comment-file it writes the fixed comment there when the decision is true. The comment never depends on the body.
Usage: go run ./tools/issueguard -tokenhound <binary> [-event <file>] [-comment-file <file>]
Exit codes: 0 decided (either way), 2 the event or the scan could not be read.