Skip to content

Commit b228c6b

Browse files
bpmctclaude
andauthored
feat(dogfood): add gh CLI workflow and GitHub auth for tasks (#21146)
Adds automatic GitHub CLI authentication and workflow instructions to the dogfood template's Claude Code tasks. The startup script now authenticates gh CLI using `coder external-auth access-token github`, eliminating manual authentication. The system prompt instructs tasks to read GitHub issue details with `gh issue view` and create feature branches with descriptive names before implementation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 3ae0600 commit b228c6b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dogfood/coder/main.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,14 @@ resource "coder_agent" "dev" {
596596
# Allow synchronization between scripts.
597597
trap 'touch /tmp/.coder-startup-script.done' EXIT
598598
599+
# Authenticate GitHub CLI
600+
if ! gh auth status >/dev/null 2>&1; then
601+
echo "Logging into GitHub CLI…"
602+
coder external-auth access-token github | gh auth login --hostname github.com --with-token
603+
else
604+
echo "Already logged into GitHub CLI."
605+
fi
606+
599607
# Increase the shutdown timeout of the docker service for improved cleanup.
600608
# The 240 was picked as it's lower than the 300 seconds we set for the
601609
# container shutdown grace period.
@@ -831,6 +839,13 @@ locals {
831839
- Built-in tools - use for everything else:
832840
(file operations, git commands, builds & installs, one-off shell commands)
833841
842+
-- Workflow --
843+
When starting new work:
844+
1. If given a GitHub issue URL, use the `gh` CLI to read the full issue details with `gh issue view <issue-number>`.
845+
2. Create a feature branch for the work using a descriptive name based on the issue or task.
846+
Example: `git checkout -b fix/issue-123-oauth-error` or `git checkout -b feat/add-dark-mode`
847+
3. Proceed with implementation following the CLAUDE.md guidelines.
848+
834849
-- Context --
835850
There is an existing application in the current directory.
836851
Be sure to read CLAUDE.md before making any changes.

0 commit comments

Comments
 (0)