Skip to content

Instantly share code, notes, and snippets.

@datalifenyc
Created January 14, 2026 04:58
Show Gist options
  • Select an option

  • Save datalifenyc/6bd72d7e56831d3eb3373589bf3b7f6a to your computer and use it in GitHub Desktop.

Select an option

Save datalifenyc/6bd72d7e56831d3eb3373589bf3b7f6a to your computer and use it in GitHub Desktop.
Coursera Course: Claude Code in Action - Module 2: Getting Hands On - GitHub Integration
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Project Setup
run: |
echo "Running CI setup..."
npm run setup:ci
echo "Starting dev server in background..."
npm run dev:daemon
echo "Waiting for server to be ready..."
for i in {1..30}; do
if curl -s http://localhost:3000 > /dev/null 2>&1; then
echo "Server is ready!"
break
fi
echo "Waiting for server... ($i/30)"
sleep 2
done
echo "Setup complete. Server logs in logs.txt"
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
show_full_output: true
claude_args: >-
--system-prompt "The project is already set up with all
dependencies installed. The server is already running at
localhost:3000. Logs from it are being written to logs.txt.
If needed, you can query the db with the 'sqlite3' cli.
If needed, use the mcp__playwright set of tools to launch a
browser and interact with the web app."
--mcp-config '
{
"mcpServers":{
"playwright":{
"command":"npx","args":[
"@playwright/mcp@latest",
"--allowed-origins",
"http://localhost:3000;https://cdn.tailwindcss.com;https://esm.sh"
]
}
}
}
'
--allowed-tools "Read,Glob,Grep,Edit,Write,Bash(npm:*),Bash(sqlite3:*),mcp__playwright__browser_navigate,mcp__playwright__browser_snapshot,mcp__playwright__browser_click,mcp__playwright__browser_type,mcp__playwright__browser_fill_form,mcp__playwright__browser_evaluate"
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'
# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment