issue_comment trigger, anyone you allow can start a verification by commenting on a pull request:
Add the workflow
issue_comment runs on the default branch, and github.sha points there, not at the pull request. The ref: refs/pull/<number>/head checkout makes the runner build the pull request’s code. The action reads the pull request itself to decide what to verify.
You can add the issue_comment trigger to your existing workflow instead of a separate file. In that case, combine the condition with your other events, as shown in Turning automatic verification off, and key the concurrency group so that a comment that isn’t a command, IronBee’s own comments included, never cancels a run:
The command
- The command must be the first line of the comment that isn’t a quote. A comment that only mentions it, or a reply that quotes it, starts nothing.
- The command is a word of its own. A comment such as
/ironbee-verify.or/ironbee-verifyinggets past the job’sstartsWithcondition, but the action reads no command in it, and the run ends without verifying anything. The action does the same with a comment on an issue that isn’t a pull request, when a job condition lets one through. - Options start with
--. Everything after the first word that isn’t an option is the instruction for the agent. So/ironbee-verify fix the cart totalis an instruction, not a request to fix. An instruction that itself starts with--needs a lone--before it. - A multi-line comment works too: the whole body below the command line is the instruction.
- The instruction replaces the workflow’s
verification_promptfor that run. A command with no instruction usesverification_prompt. - The instruction can be up to 4,000 characters.
- the comment has an unknown option. The reply shows the usage.
- the instruction is longer than 4,000 characters. The reply gives its length.
verification_command and change the startsWith condition to match.
Fixes from a comment
--fix asks the run to fix what it finds and commit the fix to the pull request branch.
- It needs an Anthropic credential.
- It is bounded by
verification_apply_fix: a repository that turned fixing off can’t turn it back on from a comment. - Without
--fix, a comment run only verifies and reports, on IronBee and on your runner.
verification_apply_fix: false or no Anthropic credential, a comment with --fix runs a verification that only reports. The report says in one line that the comment asked for --fix and fixing is off in this workflow. When IronBee publishes the run on the pull request itself, the action posts that line as a comment of its own.
Following the run
The workflow job of a comment run doesn’t appear in the pull request’s checks, so the action reacts to the comment instead:- an eyes reaction (
eyes) when it accepts the command - when the run ends, a thumbs up (
+1) for a pass, or a thumbs down (-1) for anything else: a fail, not applicable, no verdict or an error. The eyes reaction is then removed.
github_token. A malformed command gets the reply instead of a reaction. The report reaches the pull request as with any other run. See The report.
Forks
Comment commands on pull requests from forks are refused. A comment run holds the base repository’s secrets, so building and starting a fork’s code under it would hand them to whoever opened the pull request. When the action can’t tell whether the pull request comes from a fork, it refuses the run as well.Comments only
To verify only when someone comments, and never automatically on pushes and pull requests, see Turning automatic verification off. Neither theif: nor verification_auto stops a comment command.
What’s next?
Running in CI
The other triggers and the report.
Configuration
verification_command, verification_auto and every other input.