
11. From a Labeled Issue to a Pull Request Without Your Laptop
transcript
show notes
Shows how to set up the Claude Code GitHub Action so a labeled issue or an "@claude" comment produces a branch and a pre-filled pull request, including a database on the runner, a failed first run, review, and security limits. It closes with recent Claude Code changes affecting the installer, hooks, runners and auto mode.
This episode is narrated by AI-generated synthetic voices.
An issue that becomes a pull request
The Claude Code GitHub Action runs Claude Code inside a GitHub Actions job. A label on an issue, or an "@claude" comment from someone with write access, starts a GitHub-owned machine. Claude works on a new branch, runs the project's checks, pushes, and posts a link to a pre-filled pull request page. You open the pull request, review it, and merge or ask for changes. It is distinct from chat, from Claude Code on the web, and from code written against the API or Agent SDK. The Claude Code GitHub Actions documentation covers the action.
Installing it
The install-github-app slash command installs the GitHub App, stores a credential as a repository secret, and opens a pull request adding the workflow files. It needs a github.com repository and a signed-in gh tool. The manual route covers the same three steps: the App with read and write access to Contents, Issues and Pull requests, a secret (ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN), and the example workflow file. The setup guide walks through it.
The workflow file
The example listens for comments and runs only when they contain "@claude". For labels, the label_trigger input starts a run, and assignee_trigger does the same for assignment. The chapter assembled its label workflow from the documented inputs, so compare it with the usage page. The permissions block includes id-token write; without it, runs fail early with an OpenID Connect error. Leaving out prompt gives interactive mode, while setting it gives automation mode, where tools must be granted. Other options go through claude_args.
A database on the runner
The chapter adds a Postgres service container with a health check and a port mapping, then runs checkout, Node setup, npm ci and migrations before Claude's step. A test report is uploaded afterward even on failure. The GitHub guide to PostgreSQL service containers covers the setup.
A failed run, then a good one
In the illustrated example, a missing ports line causes "connection refused", fixed with one narrow commit. The rerun passes, and Claude comments with the pull request link. Review is against the three acceptance criteria, followed by running the app yourself. A pull request comment with "@claude" pushes fixes to the same branch.
Limits and security
Only write-access users can trigger runs. allowed_non_write_users is a significant security risk. Issue text is data, not orders, and stripping hidden instructions is not a guarantee. Claude cannot change workflow files, force push, or open pull requests itself. The documents describe no timeout or spending cap, so set GitHub's job timeout. See the security documentation.
Claude Code releases after 2.1.310
Per the changelog:
- 2.1.327: install-github-app asks for confirmation; a headless startup hang is fixed; mcp add-json can read settings from standard input.
- 2.1.326: hook "block" decisions now stop more calls, so check hooks that always print one.
- 2.1.325: self-hosted runners refuse symlinked session paths, except checkout-hook checkouts.
- 2.1.323: auto mode refuses gateway models with "haiku" in the name, except claude-haiku-5-5.