Inspect

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.

Configuring a GitHub push trigger

FieldTypeDescription
repository, branchstringWhere the push landed.
pusherstringGitHub login of the pusher.
pull_request_authorstringPresent when a PR author condition looked it up.
commitsarrayEach commit's SHA, message, author email, and URL.
matching_filesstring[]Changed files that matched your patterns.
all_changed_filesstring[]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.
FieldTypeDescription
eventstringWhich event fired.
pr_number, pr_title, pr_body, pr_urlstringThe pull request.
pr_head_branch, pr_head_repository, pr_head_sha, pr_base_branchstringBranches and head commit.
pr_draft, pr_labels, added_labeltextDraft state, current labels, and the label just added.
pr_author, pr_author_type, senderstringWho opened it and who caused the event.
reviewer, reviewer_type, review_body, review_url, review_idstringThe submitted review, for the two review events.
repository, repository_urlstringThe 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.

Configuring a CI failure trigger

FieldTypeDescription
check_name, resultstringThe check and its outcome.
commit_sha, commit_urlstringThe checked commit.
branch, branchestextThe checked branch or branches.
source, providerstringcheck_run or status, and the provider.
check_url, details_url, descriptionstringLinks 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.

FieldTypeDescription
comment_body, comment_kind, comment_url, comment_idstringThe comment.
comment_author, comment_author_typestringWho wrote it.
path, linetextFile and line, for inline comments.
review_statestringThe review's state, for review summaries.
pr_number, pr_title, pr_urlstringThe pull request.
pr_head_branch, pr_head_repository, pr_base_branchstringBranches.

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