Action that runs Pi agent in Forgejo CI when commenting with a reference to an llm bot
- TypeScript 97.7%
- Dockerfile 2.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
release.yaml / Generate next relase tag (push) Successful in 4s
|
||
| .devcontainer | ||
| .forgejo | ||
| .zed | ||
| examples/event_payloads | ||
| src | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc.json | ||
| .releaserc.json | ||
| .renovaterc.json | ||
| .yamllint.yaml | ||
| action.yaml | ||
| AGENTS.md | ||
| biome.jsonc | ||
| ci.Dockerfile | ||
| LICENSE | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| rolldown.config.ts | ||
| sea.json | ||
| tsconfig.json | ||
forgejo-agent
forgejo-agent is a composite GitHub Action (Forgejo-compatible) that runs an
AI coding agent in response to:
- Issue comments — when someone mentions the agent's username in a comment
- Issues opened — when a new issue is opened mentioning the agent
- Pull requests opened — when a PR is opened mentioning the agent
- Pull request review requests — when the agent is assigned as a reviewer
The agent uses the Pi Coding Agent SDK to reason about code, make changes, and interact with the repository through custom Forgejo API tools.
Features
- Responds to issue and PR comments mentioning the agent's username
- Reads issue/PR content and conversation history
- Makes code changes via git commits and pushes
- Creates, closes, and comments on issues
- Creates pull requests when working on the default branch
- Supports pull request review with findings submission
Quick Start
Add this action to your Forgejo workflow:
- uses: projects/forgejo-agent@v1
with:
# Create a token for the llm-bot user with repository:write and issue:write
# permissions.
auth-token: ${{ secrets.AGENT_TOKEN }}
# I recommend creating a separate user to restrict permissions for the agent.
auth-username: llm-bot
git-author: llm-bot
git-email: [email protected]
| Input | Description | Required |
|---|---|---|
auth-token |
Forgejo API token | Yes |
auth-username |
Username the agent responds to | Yes |
git-author |
Git author name for commits | Yes |
git-email |
Git email for commits | Yes |
Building from Source
# Install the dependencies and build.
pnpm install
pnpm build
# Run the final executable.
./dist/forgejo-agent
The build produces a single self-contained binary using Node.js SEA (Single Executable Application).
Project Structure
src/
├── main.ts # Agent session entry point
├── git.ts # Git repository cloning/checkout
├── forgejo/ # Forgejo API client
│ ├── fetch.ts # HTTP client
│ └── index.ts # API endpoint functions
├── context.ts # Runtime context from environment
├── prompt.ts # Prompt builder for the agent
├── tools.ts # Custom Forgejo tools
└── schemas.ts # TypeBox schemas
examples/
└── event_payloads/ # Sample webhook payloads
License
MIT