GitHub
GitHub triggers start a run when something happens in a repository connected to Inspect. Four trigger types are available under Add trigger > GitHub:
- Push: a push to a branch that changes a file matching your patterns.
- Pull request: pull requests opened, made ready, reopened, updated, labeled, merged, or closed.
- Status check: a completed check run or commit status with a matching result.
- PR comment: a new pull request comment, inline review comment, or review summary.
Requirements
- The repository must be added to Inspect through the Inspect GitHub app. See Repositories and GitHub.
- To have the session start on the branch that triggered it, select the same repository under the automation's Repositories. Otherwise sessions start on the repository's default branch.
Push
Choose a repository, then enter Files: comma-separated paths or glob patterns such as packages/api/**, backend/**/*.ts. Patterns match dotfiles.
- Branch takes an exact name or a glob such as
release/*. Start it with!to exclude branches, as in!gh-readonly-queue/**. Leave it blank for every branch. - Conditions narrow the push further:
- Pushed by is any of, or none of, the listed GitHub logins.
- Pusher type is Person or App or bot.
- PR author is any of, or none of, the listed logins, for the author of the pull request that introduced the pushed commit (a merged one when there are several). If Inspect can't look the pull request up, this condition doesn't match.
A push starts a run only when at least one added, modified, or removed file matches a pattern. Branch deletions and tag pushes never fire.
| Field | Type | Description |
|---|---|---|
repository, branch | string | Where the push landed. |
pusher | string | GitHub login of the pusher. |
pull_request_author | string | Present when a PR author condition looked it up. |
commits | array | Each commit's SHA, message, author email, and URL. |
matching_files | string[] | Changed files that matched your patterns. |
all_changed_files | string[] | Every changed file in the push. |
Each trigger starts at most one run per pushed head commit, so redeliveries don't start another. Two push triggers on one automation that both match start two runs.
Pull request
Choose a repository, or keep All repositories to watch every repository in Inspect, including ones added later. Under Events, choose what fires it:
- Opened: a pull request is opened, including as a draft.
- Marked ready for review: a draft becomes ready.
- Reopened: a closed pull request is reopened.
- New commits pushed: the pull request's branch gets new commits.
- Label added: a label is added.
- Merged: the pull request merges.
- Closed without merging: the pull request closes unmerged.
- Approval submitted: someone submits a review that approves the pull request.
- Change request submitted: someone submits a review that requests changes.
New triggers start with Opened and Marked ready for review plus a Draft is No condition, so each pull request fires once when it's ready for review. Remove the draft condition to include drafts.
Conditions (all must match):
- Author is any of, or none of, the listed GitHub logins, such as
dependabot[bot]. - Author type is Person or App or bot.
- Source branch or Target branch matches any of, or none of, glob patterns such as
dependabot/**. - Files matches any of, or none of, glob patterns against the changed files, including the old path of renamed files. GitHub lists at most 3,000 files per pull request.
- Draft is yes or no.
- Labels include any of, or none of, the listed labels.
- Title contains, does not contain, starts with, ends with, is exactly, or is not exactly a value. Text matching ignores case.
- Number is any of, or none of, specific pull request numbers.
| Field | Type | Description |
|---|---|---|
event | string | Which event fired. |
pr_number, pr_title, pr_body, pr_url | string | The pull request. |
pr_head_branch, pr_head_repository, pr_head_sha, pr_base_branch | string | Branches and head commit. |
pr_draft, pr_labels, added_label | text | Draft state, current labels, and the label just added. |
pr_author, pr_author_type, sender | string | Who opened it and who caused the event. |
reviewer, reviewer_type, review_body, review_url, review_id | string | The submitted review, for the two review events. |
repository, repository_url | string | The repository. |
The session starts on the pull request's head branch, or on its target branch for Merged and Closed without merging. With All repositories, select (Auto) under Repositories so each run starts in the pull request's repository.
Each trigger starts at most one run per pull request, event, and head commit (and per label for Label added, or per review for the review events). Author conditions match the pull request's author, not the reviewer. Reviews that only leave comments don't fire the review events; use a PR comment trigger for those.
For example, to triage every Dependabot pull request across your organization: keep All repositories and the default events, add Author is any of dependabot[bot], select (Auto) under Repositories, and write the triage steps as the prompt.
To add checks to each pull request's review instead, see Review agent repository rules. To approve pull requests from particular authors, see Approval agent.
Status check
Choose a repository and one or more Results. New triggers select the failure results: failure, error, timed out, startup failure, and action required. The other results are success, cancelled, neutral, and skipped.
- Branch is an exact branch name for the commit being checked, not a pull request's target branch. Events whose branch GitHub doesn't report are skipped when Branch is set.
- Check names takes comma-separated names or glob patterns such as
buildkite/**. Leave it blank for every check.
The trigger fires on completed check runs and on commit statuses that aren't pending, including on branches without an open pull request. Check suite summaries never fire, because their check runs already do.
| Field | Type | Description |
|---|---|---|
check_name, result | string | The check and its outcome. |
commit_sha, commit_url | string | The checked commit. |
branch, branches | text | The checked branch or branches. |
source, provider | string | check_run or status, and the provider. |
check_url, details_url, description | string | Links and the check's summary. |
Each trigger starts one run per check, result, and commit. Reruns that report the same result on the same commit don't start another run.
For "whenever a check fails on main, triage and fix it", select the repository, set Branch to main, keep the default results, select the same repository under Repositories, and write that instruction as the prompt.
PR comment
Choose a repository and add conditions. All must match:
- Comment text contains, does not contain, starts with, ends with, is exactly, or is not exactly a value. Matching ignores case.
- Comment types: conversation comments on the pull request timeline, inline review comments on the diff, or submitted review summaries.
- Author type is Person or App or bot.
- Comment author is any of, or none of, the listed GitHub logins.
New triggers start with Author type is Person. Removing every condition matches bot comments too, which loops if the automation comments on the same pull request.
Only new comments fire; edits and deletions don't. A review submitted with only inline comments fires through those inline comments, not through its empty summary.
| Field | Type | Description |
|---|---|---|
comment_body, comment_kind, comment_url, comment_id | string | The comment. |
comment_author, comment_author_type | string | Who wrote it. |
path, line | text | File and line, for inline comments. |
review_state | string | The review's state, for review summaries. |
pr_number, pr_title, pr_url | string | The pull request. |
pr_head_branch, pr_head_repository, pr_base_branch | string | Branches. |
The session starts on the pull request's head branch when the pull request comes from the same repository. Pull requests from forks start on the default branch.
Each comment starts at most one run per trigger. Anyone who can comment on the pull request can fire the trigger, so have the prompt check the commenter's permissions before acting on a request.
For example, Comment text starts with /inspect and Author type is Person lets reviewers ask Inspect for help directly from a pull request.
Troubleshooting
No changed file matched Files, the branch didn't match, or the push was a branch deletion or tag.
The default Draft is No condition. Remove it or add Marked ready for review.
The provider doesn't report the branch for that check. Clear Branch and filter in the prompt.
The repository isn't selected under Repositories, or the pull request comes from a fork.
The trigger has no Author type is Person condition, so the automation's own comments match.