How yellowback/forgejo-claude-code-action works
Claude Code Action turns GitHub or Forgejo issue/PR activity into a Claude run, with modes for mention-driven or automated execution. The main path parses the event, checks triggering and permissions, gathers platform context, builds a prompt, and runs Claude; follow-up entrypoints manage comment links and progress. The README also documents code review, implementation, GitHub/file tools, and multiple authentication providers. Source excerpts show orchestration and fetch/prompt behavior, but not all runtime integrations, so uncertain links are omitted.
Main entry points: prepare.ts Prepare run · install-mcp-server.ts MCP installation · data-fetcher.ts Platform data fetch · rest-adapter.ts Platform client adapter
Components 24
Event workflow
- Prepare run
src/entrypoints/prepare.ts - Parse event context
src/github/context.ts - Execution modes
src/modes/registry.ts - Trigger checks
src/modes/tag/index.ts - Actor permissions
src/github/validation/permissions.ts - Comment lifecycle
src/github/operations/comments/create-initial.ts - Branch operations
src/github/operations/branch.ts - Comment-link update
src/entrypoints/update-comment-link.ts
Platform integration
- GitHub data fetch
src/github/data/fetcher.ts - Platform data fetch
src/platform/data-fetcher.ts - Platform client adapter
src/forgejo/api/rest-adapter.ts - Forgejo API
src/forgejo/api/client.ts - GitHub API client
src/github/api/client.ts
Claude execution
- Prompt assembly
src/create-prompt/index.ts - Claude runner
base-action/src/run-claude.ts - Action entry
base-action/src/index.ts - Turn formatting
src/entrypoints/format-turns.ts
Assistant tools
- MCP installation
src/mcp/install-mcp-server.ts - GitHub Actions tools
src/mcp/github-actions-server.ts - GitHub comment tools
src/mcp/github-comment-server.ts - GitHub file tools
src/mcp/github-file-ops-server.ts
Other components
- Repository user
- GitHub
- Forgejo
Connections 26
- Repository user → Prepare run: triggers workflow
README.md - Prepare run → Parse event context: parses event
src/entrypoints/prepare.ts - Parse event context → Execution modes: validates mode
src/github/context.ts - Execution modes → Trigger checks: selects tag mode
src/modes/registry.ts - Prepare run → Actor permissions: checks actor
src/entrypoints/prepare.ts - Prepare run → GitHub data fetch: fetches context
src/entrypoints/prepare.ts - Prepare run → Platform data fetch: fetches platform data
src/entrypoints/prepare.ts - Platform data fetch → Platform client adapter: creates client
src/platform/data-fetcher.ts - Platform client adapter → Forgejo API: uses Forgejo API
src/forgejo/api/rest-adapter.ts - Platform client adapter → GitHub API client: uses GitHub API
src/forgejo/api/rest-adapter.ts - GitHub data fetch → GitHub API client: queries API
src/github/data/fetcher.ts - Platform data fetch → GitHub: requests data
- Forgejo API → Forgejo: requests data
src/forgejo/api/client.ts - Prepare run → Comment lifecycle: creates initial comment
src/entrypoints/prepare.ts - Prepare run → Branch operations: sets up branch
src/entrypoints/prepare.ts - Prepare run → MCP installation: installs tools
src/entrypoints/prepare.ts - Prompt assembly → GitHub data fetch: formats fetched data
src/create-prompt/index.ts - Prepare run → Prompt assembly: generates prompt
src/entrypoints/prepare.ts - Action entry → Claude runner: runs Claude
base-action/src/index.ts - Claude runner → GitHub: uses configured provider
- Prepare run → Comment-link update: updates later
- Comment-link update → Comment lifecycle: updates comment
src/entrypoints/update-comment-link.ts - MCP installation → GitHub Actions tools: registers tool
src/mcp/install-mcp-server.ts - MCP installation → GitHub comment tools: registers tool
- MCP installation → GitHub file tools: registers tool
src/mcp/install-mcp-server.ts - Claude runner → Turn formatting: formats turns