Skip to content

Working with GitHub

What you will learn: How to use the project GitHub page (/projects/{id}/github) and the scion project github CLI to connect a project to the Hub’s GitHub App, adjust token permissions, grant read-only access to sibling repositories, and configure GitHub commands and event automations.

When a project is connected to the Hub’s GitHub App:

  • Short-lived, scoped tokens: agents receive GitHub App installation tokens limited to the project’s repository and token permissions, refreshed automatically by sciontool.
  • Agents act as the App: commits, comments, and reviews posted with the installation token are attributed to the GitHub App rather than a personal account.
  • GitHub automation (experimental): with hub.triggers and hub.github_triggers enabled, GitHub commands (@<app-slug> /<command>) and repository events (pull requests, issues, labels, reviews) can start agents, message running agents, or post comments.

Open your project in the Web UI and click GitHub in the project header (or open Settings and click Manage → or Set up → on the GitHub row). The page URL is /projects/{id}/github.

The page appears only when the Hub’s GitHub App is configured and the project’s git remote is on the App’s GitHub host (github.com or the configured GitHub Enterprise host). Otherwise /projects/{id}/github returns 404.

At the top of the page, the status header summarizes:

  • Connection state: Connected, Degraded, Error, Unchecked, Unverified, Not authorized, or Not connected.
  • Repository: the parsed owner/repo from the project’s git remote.
  • App: the App’s @<app-slug> mention handle.
  • Installation: the installation account, numeric ID (account · #id), and authorization basis.
  • Triggers readiness (with an Automation → shortcut link) and Routing (when hub.triggers and hub.github_triggers are enabled).

The tabs always appear in order: Automation (when GitHub triggers are enabled), Agent access, and Connection. While a project is disconnected, Connection is selected and Automation and Agent access are disabled with (connect first).

The Connection tab manages the project’s association with a GitHub App installation and checks token-minting health.

Card status Header status API state Meaning
Active Connected ok The association is authorized and the last token mint succeeded.
Degraded Degraded degraded The association exists, but a permission or installation issue prevents normal token minting (for example permission_denied).
Error Error error Token minting failed (for example installation_revoked, installation_suspended, or repo_not_accessible). Agents fall back to a GITHUB_TOKEN secret if one is available.
Unchecked Unchecked unchecked Connected, but no token mint has been recorded yet. Click Check Status to verify.
(header/basis) Unverified / Not authorized — The Hub has not yet verified the association, or the authorization check failed (association_unauthorized).

For the complete list of error codes and how to fix each one, see Project status codes.

A project’s association with an installation must be authorized in one of two ways:

A Hub administrator can bind the installation directly so token minting does not depend on any individual user’s personal token:

  1. Open /projects/{id}/github and select the Connection tab.
  2. If the GitHub App is not installed on the repository’s organization or account yet, click Install the GitHub App, complete the installation on GitHub, and return to the page.
  3. Click Bind installation (or Discover Installation first if the Hub has not synced the new installation yet).
  4. If multiple active installations match the repository owner, choose the installation from the list and click Bind #<id>.
  5. Confirm the dialog. The Authorized by field updates to Bound by <admin> on <date>, and write permissions are allowed.
  6. Click Check Status to verify token minting and transition the status from Unchecked to Active (Connected in the header).

CLI equivalent:

Terminal window
scion project github bind
# Or specify an installation ID explicitly:
scion project github bind --installation 12345678

If you are the user who created the project and do not have Hub admin privileges:

  1. Store a personal GitHub token named GITHUB_TOKEN with access to the project’s repository in your user secrets (/profile/secrets, or scion hub secret set GITHUB_TOKEN <token>). Only the project creator’s token counts.
  2. Ask a Hub admin to run Discover (the Hub admin’s Discover Installation button) or install the App on the account. When the Hub discovers an active installation covering the repository, it associates the project automatically.
  3. Check Authorized by on the Connection tab:
    • Creator proof (write allowed) — your token has push access to the repository.
    • Creator proof (read-only) — your token has pull access only; every minted token is capped to read-only.

When a project is not connected, users without Hub admin permissions see a How to connect panel listing both options, including the exact scion project github bind --project <slug-or-id> command to share with a Hub admin and a link to /profile/secrets.

Checking, configuring, or removing a connection

Section titled “Checking, configuring, or removing a connection”

Once connected, project admins see these controls on the Connection tab:

  • Check Status / Recheck Status: runs an active check (POST /api/v1/projects/{id}/github-status) by minting a test token and updating the recorded status and Last Token Mint timestamp.
  • Configure Installation: opens the installation’s settings page on GitHub so an installation owner can add or remove repositories or accept updated App permissions.
  • Bind installation: shown to Hub admins when the project is currently connected via creator proof, letting them upgrade the association to an admin binding.
  • Remove: removes the installation association and any Hub-admin binding from the project (scion project github unbind). Agents fall back to a GITHUB_TOKEN secret if one is configured.

The Agent access tab controls what GitHub permissions agents receive for the primary repository and which sibling repositories agents can read.

The Token Permissions table shows six GitHub App repository permissions—Contents, Pull requests, Issues, Checks, Actions, and Metadata—across five columns:

Column Meaning
Permission The GitHub App repository permission name.
Requested What the project asks for (either the Hub defaults or your custom selection).
App grant What the Hub’s GitHub App is currently granted on GitHub.
Effective What minted tokens actually receive after caps are applied.
Note Explains why a permission is capped or warns if a custom request exceeds the App grant.

Two modes are available to project admins:

  • Use defaults (capped to App grant) (Default): the Hub requests contents: write, pull_requests: write, issues: write, and metadata: read, and automatically caps each permission to what the App grants (dropping permissions the App lacks and lowering write to read where the App grants only read).
  • Custom: lets you choose none, read, or write per permission (at least one permission must be read or write) and click Save permissions. Click Reset to defaults to return to default mode.

Two cap reasons can appear in the Note column:

  • app_grant (“App not granted <level> — update the App on GitHub”): in default mode, the Hub lowered or omitted the permission because the App does not hold it.
  • association_read_only (“Association is read-only — ask a hub admin to bind”): the project is authorized via read-only creator proof (creator_pull), so every write permission is lowered to read at mint time.

If GitHub triggers are enabled and require permissions the App does not yet hold, a notice below the table lists them (“Triggers also need …”).

CLI equivalents:

Terminal window
# Inspect requested, App-granted, and effective permissions
scion project github permissions
# Replace with a custom set (unspecified permissions become none)
scion project github permissions set contents=write pull_requests=write issues=read metadata=read
# Return to default mode (capped to the App grant)
scion project github permissions reset

Extra read-only repositories let agents in a project read sibling repositories—such as shared libraries, proto definitions, private gh:// skills, or git submodules—without granting write access or handing out personal access tokens.

Rules and limits:

  • Same installation account: every extra repository must belong to the same GitHub organization or account as the project’s installation (owner_mismatch otherwise) and be accessible to that installation (repo_not_in_installation otherwise).
  • At most 20 repositories per project (cannot duplicate the project’s primary repository).
  • Strictly read-only: the Hub mints a separate extra-read installation token with contents: read (and metadata: read).
  • Hub policy (github_app.extra_repos_policy): shown as a chip in the card header:
    • Policy: Project admins (project_admin): project admins can add and remove repositories.
    • Policy: Hub admins only (hub_admin): only Hub admins can edit the list; other users see a read-only notice.
    • Policy: Disabled by hub policy (off): editing is disabled and agents receive no extra-read tokens until a Hub admin re-enables the policy.
  • Creator-proof associations: when a project is connected by creator proof rather than an admin binding, the project creator’s GITHUB_TOKEN must also have read (pull) access to each extra repository. The Hub checks this when you add a repository (creator_no_access) and re-checks it at token mint time (failing closed if access is denied or the check times out). To avoid depending on the creator’s access, ask a Hub admin to bind the installation.

Adding and removing repositories:

  1. On the Agent access tab, open the Extra read-only repositories card.
  2. Enter <owner>/<repo> in Add repository and click Add repository.
  3. To remove a repository, click Remove on its row.

CLI equivalents:

Terminal window
scion project github repos list
scion project github repos add acme/shared-lib acme/protos
scion project github repos remove acme/shared-lib

What agents can and cannot do:

  • Can do: run git clone, git fetch, and git submodule update over HTTPS against listed repositories (supplied on demand by sciontool’s git credential helper), and resolve hub-side gh:// skills from them. The extra-read token is never stored in the agent’s environment variables or container files.
  • Cannot do: push to extra repositories, or use the gh CLI against them (gh uses only the project’s primary repository token).

Extra repository statuses:

Status Meaning
ok Accessible by the project’s installation and ready for read-only token minting.
removed from installation The repository was removed from the GitHub App installation on GitHub. It stays listed so you can see why reads stopped; re-add it to the installation on GitHub or click Remove.
not in installation Not currently covered by the project’s installation.
owner mismatch Repository owner does not match the installation’s account.
creator lacks access For a creator-proof association, the project creator’s token was denied read access.

The Automation tab is the single place to configure GitHub commands, event automations, and unmatched-command replies for your project.

A GitHub command is an @<app-slug> /<command> [args] mention in a pull request or issue comment (or, if enabled, in the opening body or a review comment). The Commands card header displays your App’s mention format (mention @<app-slug> /<command>).

Each row in the Commands table shows:

Column Meaning
Command The /<command> word and its unique trigger name. A Preset updated — review badge appears if the preset schema has been updated since the rule was compiled; click Edit and Recompile to update.
Applies to Pull requests, Issues, or PRs & issues.
Who may trigger members+ for the default trusted set (OWNER, MEMBER, COLLABORATOR), or the explicit author-association chips, plus bots and forks chips when enabled.
What happens Summary of the first action (Start agent from <template>, Message <agent>, or Comment) and (+N more) for multi-action rules.
Agent per PR/issue new each time, reuse one, or skip if active.
Ack Check mark when an acknowledgement comment is configured on a dispatch action.
Status active or paused, plus the relative time of the last fire.

Row actions let you Edit, Pause / Resume, or delete (trash icon) any command.

Click Add command to open the dialog:

  1. Command & Trigger name: enter the command word without a leading slash (for example review). Trigger name defaults to github-<command> when left blank (or you can enter a custom name).
  2. Applies to: choose Pull requests, Issues, or Both.
  3. Who may trigger: select which GitHub author associations may invoke the command (defaults to OWNER, MEMBER, COLLABORATOR), and optional checkboxes:
    • Allow bots: allow bot accounts (sender_type == "Bot"). Off by default.
    • Include review comments: also parse commands in pull request review comments. On by default for pull requests.
    • Include forks: allow invocations on pull requests from forked repositories. Off by default.
    • Include body: also parse commands in the pull request or issue opening body, not just comments. Off by default.
  4. Actions: configure one or more actions (up to 8 per rule):
    • Dispatch agent (default): start an agent from a template with a task prompt (Template is a free-text field—enter an existing template name such as default or developer). Optional fields (Agent name template, Branch template, Name conflict, Add label, Ephemeral agent, and Reuse message when Reuse one is selected) can be left at their defaults. Under GitHub dispatch options:
      • GitHub token: choose Installation token (default for GitHub sources—authenticates the agent as the App and suppresses user/project PATs), User token preferred, or Default (Hub installation token).
      • Acknowledge with a comment: check to post an acknowledgement comment after the agent is dispatched. The Acknowledgement comment body supports ${result.agent_name}, ${result.agent_url}, and ${event.*} placeholders and requires the github_trigger.comment permission.
      • Agent role: uses the project/Hub default role ladder (capped by the project maximum and the rule author’s delegation ceiling) unless you set an explicit role on the action.
    • Message: deliver an event envelope to an existing agent in the project.
    • Comment (github.comment): select Comment as the Action type in the action editor (or add another action and choose Comment). Fill in Comment body (supports ${event.*} placeholders; requires github_trigger.comment), keep Target set to Issue / PR from event, and optionally check Reply in review comment thread when the rule matches pull request review comments.
  5. Agent per PR/issue:
    • New each time (new): starts a fresh agent for each invocation.
    • Reuse one (reuse): delivers follow-up invocations on the same PR or issue to the existing live agent holding the subject claim.
  6. Review the Fires on: summary (and optional Show compiled rule (CEL) disclosure) and click Save.

To set up an on-demand pull request reviewer triggered by @<app-slug> /review:

  1. Open /projects/{id}/github and select the Automation tab.
  2. In the Commands card, click Add command.
  3. Set Command to review (Trigger name defaults to github-review when left blank).
  4. Leave Applies to on Pull requests and Who may trigger on OWNER, MEMBER, COLLABORATOR (with Allow bots and Include forks unchecked).
  5. In the action editor, keep Dispatch agent, type your template name in Template (a free-text field, for example default or developer), and enter a task prompt (for example, Review PR #${event.attributes.number} in ${event.attributes.repo} and post your findings as a PR review.). The optional dispatch fields (Agent name template, Branch template, Name conflict, Add label, Ephemeral agent, and Reuse message when Reuse one is selected) can be left at their defaults.
  6. Under GitHub dispatch options, keep GitHub token on Installation token and check Acknowledge with a comment if you want the App to reply with a link to the started agent.
  7. Choose Reuse one under Agent per PR/issue if you want follow-up /review comments on the same PR to reach the same agent, or New each time for a fresh agent per invocation.
  8. Confirm the Fires on: sentence reads @<app-slug> /review by OWNER, MEMBER, COLLABORATOR on a pull request (not from a bot, not from a fork, including review comments)., then click Save.
  9. On a pull request in the repository, post a comment containing @<app-slug> /review (with no trailing punctuation directly after review).

Teams commonly build a small set of commands on the Automation tab covering review, fixes, planning, triage, and help:

Command Applies to Who may trigger What happens Agent per PR/issue Ack
/review Pull requests members+ Dispatch reviewer template Reuse one Yes
/fix Pull requests members+ Dispatch developer template Reuse one Yes
/plan Issues members+ Dispatch architect template New each time Yes
/triage Issues members+ Message project lead agent New each time —
/help PRs & issues members+ Comment (github.comment) listing available commands New each time —

Below Commands, the Event automations section reacts to repository lifecycle events without requiring a mention. Click Add automation, choose an Event, and configure its filters and actions:

Event card Preset ID Triggers on Key options & defaults
PR opened github.pr_opened Pull request opened, reopened, or marked ready for review Base branches (default default = repo default branch), Who may trigger, Include drafts, Include forks, Allow bots. Default subject mode: New each time.
PR updated github.pr_updated New commits pushed to a pull request Base branches (default default), Coalesce window (default 30s; whole-second window across rapid pushes, 0s disables, max 10m), Who may trigger, Include drafts, Include forks, Allow bots. Default subject mode: Reuse one.
Issue opened github.issue_opened New issue opened Match any of these labels (optional) (blank matches all opened issues), Who may trigger, Allow bots. Default subject mode: New each time.
Label added github.label_added Exact Label name added to a PR or issue Label name (required), Applies to (PRs & issues, Pull requests, Issues), Include forks, Allow bots. Default subject mode: New each time.
Review submitted github.review_submitted Pull request review submitted in selected states Review states (approved, changes_requested, commented; default changes_requested), Who may trigger, Include forks, Allow bots. Default subject mode: New each time.

Base branches (in PR opened and PR updated), Match any of these labels (optional) (in Issue opened), and Label name (in Label added) load branch and label suggestions from the repository. You can also type custom values directly (press Enter or separate with commas for multi-value fields), and the inputs fall back to plain free text if suggestions are unavailable.

Each configured automation appears as a card grouped under its event type, with Edit, Pause / Resume, and delete controls.

The Unmatched commands card controls what happens when a comment mentions @<app-slug> /<unknown> and no command rule matches:

  • Off by default: no reply is posted.
  • Check Reply once when a comment mentions an unknown command to post a fallback guidance reply (at most once per minute per issue or pull request).
  • Optionally enter Additional reply text (optional) (byte-counted) to append project-specific instructions, then click Save.

CLI equivalent:

Terminal window
scion trigger github settings --unmatched-command-reply=true \
--unmatched-command-text "Try /review, /fix, or /help."
  • Advanced rules: GitHub triggers authored with hand-written CEL (outside the preset forms) appear read-only under Advanced rules with a View CEL disclosure and Edit on Triggers page / Open Triggers page links.
  • Recent trigger events and delivery history: click View trigger events to open the Events tab (/projects/{id}/triggers?tab=events) for received events, attributes, and match/fire counts; switch to the adjacent History tab for detailed per-fire outcomes.

How GitHub rules appear on the Triggers page

Section titled “How GitHub rules appear on the Triggers page”

On the project Triggers page (/projects/{id}/triggers):

  • A compact GitHub reference card at the top displays association status, command and event-automation counts, trigger readiness, and a Manage on GitHub page → link (with no inline configuration controls).
  • In the Rules tab, commands and event automations created on the project GitHub page show a Managed on GitHub page badge and an Edit on GitHub page link in place of the inline edit button. You can still Preview render, Pause / Resume, or Delete them from the Triggers page.
  • Click Detach form on a managed GitHub rule to convert it into a CEL-only rule editable on the Triggers page (and listed under Advanced rules on the GitHub page), keeping its compiled match rules and actions unchanged. Detaching is one-way from the Triggers page, is refused if the rule’s stored match rules are corrupt, and if the rule was modified concurrently closes the dialog, refreshes the list, and reports “This rule was changed elsewhere; reopen to detach.”
  • Choosing GitHub when creating a new rule on the Triggers page redirects to the project GitHub page’s add dialog.

For generic webhook endpoints, ordered CEL/System One rules, templating, offline queues, and fire history, see Triggers & Webhooks.

All project GitHub operations have CLI equivalents under scion project github (pass --project <id-or-slug> or run inside a linked project directory):

Command Who can run Purpose
scion project github status Human or agent Show association, health status, and effective token permissions table.
scion project github bind [--installation <id>] Hub admin (human only) Bind an active GitHub App installation to the project (auto-selects when one matches the remote owner).
scion project github unbind Project admin (human only) Remove the installation association and any Hub-admin binding.
scion project github permissions Human or agent Show requested, App-granted, and effective token permissions.
scion project github permissions set <key>=<level>... Project admin (human only) Replace with custom token permissions (contents, pull_requests, issues, metadata, checks, actions; levels none, read, write).
scion project github permissions reset Project admin (human only) Reset token permissions to defaults (capped to the App grant).
scion project github repos list Human or agent List configured extra read-only repositories, policy, and per-repo status.
scion project github repos add <owner/repo>... Per hub policy (human only) Add one or more extra read-only repositories.
scion project github repos remove <owner/repo>... Per hub policy (human only) Remove one or more extra read-only repositories.

For GitHub trigger readiness, routing, and unmatched-command settings from the CLI, use scion trigger github status and scion trigger github settings (human only).

When GitHub triggers are enabled, the Routing item in the project GitHub page header shows how webhook events for your repository are delivered:

  • Events for <owner/repo> go to this project: this is the only associated project for the repository.
  • Events for <owner/repo> go to <project> (primary project): a Hub admin pinned a primary project for this repository so events go only there.
  • Multiple projects share <owner/repo> — events fan out to all (warning): several projects on the Hub are associated with the same repository and no primary project is pinned, so every associated project receives every event.

Only a Hub administrator can pin or change the primary project for a repository (see Auth & Tenancy: GitHub App Integration).

  • Readiness shows missing events or permissions: the Hub’s GitHub App is missing a permission or webhook event subscription required for triggers. Ask a Hub admin to update the App on GitHub, have the installation owner accept the updated permissions, and sync permissions (see GitHub App Setup).
  • A GitHub command did not fire:
    1. Check the Connection tab: confirm the status is Active (ok) and the association is authorized.
    2. Check the Routing indicator in the header to confirm events for this repository reach this project.
    3. Check Who may trigger on the command row: verify the commenter’s GitHub author association is included, and check Allow bots, Include forks, Include review comments, and Include body as needed.
    4. Check the comment syntax: trailing punctuation directly after the command word blocks parsing—for example, @acme-scion /review. does not match /review (the command word must end at whitespace or the end of the line). Mentions inside fenced code blocks, inline backticks, > blockquotes, <!-- ... --> HTML comments, or edited comments are also ignored.
    5. Click View trigger events to inspect the recorded event’s attributes (command, author_association, sender_type, enriched).
  • Connection status is Degraded or Error: click Recheck Status and look up the error code in Project status codes.
  • Extra repository shows removed from installation or creator lacks access: re-add the repository to the GitHub App installation on GitHub (or remove it from the project). For creator-proof projects showing creator lacks access, grant the project creator read access on GitHub or ask a Hub admin to bind the installation.