shaftoe/pi GitHub Action

Run the pi coding agent (pi.dev) in GitHub Actions workflows

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
github_tokenGitHub token for API access. The default `GITHUB_TOKEN` works for all standard operations. To use `share_session`, provide a classic PAT (`gist` scope), fine-grained PAT (Account → Gists: read/write), or GitHub App token instead — the default `GITHUB_TOKEN` cannot create gists.yes
providerLLM provider (e.g. openai, google, anthropic, zai, etc.)yes
modelModel to use (e.g., gpt-5.4, gpt-4o, gemini-2.5-pro)yes
tokenAPI token for the LLM provider. Required for most providers, but can be omitted when using providers that support alternative auth mechanisms (e.g. google-vertex with Application Default Credentials).no
thinking_levelThinking level (e.g. off, low, medium, high, etc.)nooff
promptOptional prompt to send to the agent. When provided, the trigger phrase is not required and the prompt is used as-is (useful for non-interactive workflows such as PR reviews, assignment triggers, or scheduled tasks). Falls back to extracting the prompt from the triggering comment if not set.no
triggerTrigger phrase for the pi agent (e.g. /pi )no/pi
extensionsCustom Pi extensions to load (one per line). Supports npm packages (npm:package-name), git repos (git:github.com/user/repo), or local file paths.no""
load_builtin_extensionsWhether to load built-in GitHub extensions (see Custom Tools section in README for the full list)notrue
loaded_toolsControls which tools are loaded into the session. Defaults to 'all' which loads all available tools (built-in + custom). Accepts a list of tool names (one per line) to load only those tools. Tool names must match exactly — unknown names cause the run to fail early.noall
diff_max_linesMaximum number of diff lines returned by the get_pr_diff tool. Defaults to 1000.no1000
diff_max_bytesMaximum diff size in bytes returned by the get_pr_diff tool. Defaults to 100KB.no102400
diff_ignore_patternsSpace-separated list of file patterns to exclude from PR diffs by default (e.g. "dist/ package-lock.json"). The agent can still provide additional patterns at call time.no""
branch_name_templateTemplate for auto-generated branch names in create_pull_request. Supports variables: {number} (issue/PR number), {timestamp} (epoch ms), {title} (slugified PR title). Default: "pi/issue{number}-{timestamp}"no""
base_urlOptional override for the provider base URL (e.g. to route OpenAI traffic through a proxy or use an OpenAI-compatible gateway).no""
export_session_htmlExport the Pi session as a self-contained HTML file and expose its path via the `session_html_path` output. Set to false to disable. Auto-enabled when share_session is true.nofalse
export_session_jsonlExport the Pi session as a JSONL file (one JSON object per line) and expose its path via the `session_jsonl_path` output. Set to true to enable.nofalse
share_sessionShare the session like pi's /share command: upload the exported session HTML to a secret GitHub Gist and surface a pi.dev-style viewer link. Uses the github_token input to create the gist, so provide a PAT/App token with gist scope there (the default GITHUB_TOKEN cannot create gists). Auto-enables export_session_html.nofalse
share_gist_providerStorage backend for session sharing. Defaults to `github` (GitHub Gists + pi.dev viewer). Set to `opengist` to upload to a self-hosted Opengist instance instead — in that case also set share_gist_api_url (and a share_gist_token or github_token with gist:write access). When opengist is used, share_url points at a self-rendering raw-HTML link (the pi.dev viewer cannot read non-GitHub gists).nogithub
share_gist_api_urlAPI URL for the share gist provider. Required when share_gist_provider is `opengist`: the instance's create endpoint, e.g. `https://gist.l3x.in/api/gists` (Opengist's REST API lives under /api/, not /api/v1/). Optional override for the github provider (defaults to https://api.github.com/gists).no""
share_gist_tokenToken used to create the shared gist. For opengist, an Opengist access token (og_…) with the gist:write scope — this is required (there is no github_token fallback, since a GitHub token cannot authenticate against a self-hosted Opengist instance). For the github provider, falls back to github_token when unset, so it keeps working with a single token.no""
auto_compactionEnable automatic context compaction when the conversation grows too large for the model context window. When enabled, Pi will summarize older messages to free up context space, allowing longer sessions without hitting context limits.nofalse
pr_numberPull request number to target. Use this with workflow_dispatch to run the agent on a specific PR without a triggering event. When set, the action fetches PR context and posts the result as a comment on the specified PR.no""
platformGit hosting platform the action is running on. One of github (default), codeberg, forgejo, or gitea (alias for forgejo). Determines platform-specific behaviour such as the action-run URL format used in the "View action run" footer. The platform is no longer auto-detected from the server URL, so set this explicitly when running on Forgejo/Codeberg/Gitea (e.g. platform: forgejo).nogithub
server_urlOverride the forge server URL (e.g. https://git.example.com). Self-hosted runners (Forgejo/Gitea behind Docker or internal networking) may advertise a GITHUB_SERVER_URL that is only reachable from inside the host network (e.g. http://localhost:3000); set this to the externally-reachable URL so that derived links (commits, PRs, action runs) point at the right host. When unset, the runner-advertised GITHUB_SERVER_URL is used. Note: this only affects user-facing URLs — the API client keeps using the runner-advertised GITHUB_API_URL, and platform selection is controlled by the platform input.no""
namedescription
responseThe main agent response text
successWhether the agent completed successfully (true/false)
input_tokensNumber of input tokens consumed
output_tokensNumber of output tokens generated
costCost of the invocation in USD
duration_secondsWall-clock duration of agent execution in seconds
session_html_pathPath to the exported session HTML file (when export_session_html is enabled, or when share_session is enabled)
session_jsonl_pathPath to the exported session JSONL file (when export_session_jsonl is enabled)
share_urlShareable session link. For the github provider: a pi.dev viewer link (https://pi.dev/session/#<gistId>). For the opengist provider: a self-rendering raw-HTML URL on the configured instance. Set when share_session is enabled and succeeds.
gist_urlURL of the gist holding the shared session HTML (GitHub Gist page or Opengist page), when share_session is enabled and succeeds
gist_idID of the gist holding the shared session HTML, when share_session is enabled and succeeds