Action that runs Pi agent in Forgejo CI when commenting with a reference to an llm bot
  • TypeScript 97.7%
  • Dockerfile 2.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Renovate [bot] b8e08411c0
All checks were successful
release.yaml / Generate next relase tag (push) Successful in 4s
chore(deps): update dependency rolldown to v1.2.0 (#158)
2026-07-18 17:19:45 +00:00
.devcontainer ci(deps): update ci dependencies (#154) 2026-07-17 07:11:33 +00:00
.forgejo ci(deps): update https://git.zarantonello.dev/projects/forgejo-agent action to v1.8.3 (#157) 2026-07-18 17:19:11 +00:00
.zed feat: add create-pr-review tool (#99) 2026-06-27 11:48:23 +00:00
examples/event_payloads feat: add close and create issue tools (#19) 2026-06-18 18:32:35 +00:00
src feat: make repository/issuenumber inputs in tools optional (#141) 2026-07-10 23:28:35 +00:00
.gitignore feat: initial commit 2026-06-16 23:43:41 +02:00
.prettierignore feat: initial commit 2026-06-16 23:43:41 +02:00
.prettierrc.json docs: add README.md and AGENTS.md (#49) 2026-06-20 14:20:10 +00:00
.releaserc.json feat: refactor into a composite action (#12) 2026-06-18 11:48:11 +00:00
.renovaterc.json chore: fix lints 2026-06-17 10:21:16 +02:00
.yamllint.yaml fix: replace tag in action.yaml on release 2026-06-17 18:33:54 +02:00
action.yaml chore(release): v1.8.3 2026-07-18 09:38:59 +00:00
AGENTS.md fix: migrate to new projects org (#86) 2026-06-24 16:59:01 +00:00
biome.jsonc chore(deps): update dependency @biomejs/biome to v2.5.4 (#156) 2026-07-18 17:18:33 +00:00
ci.Dockerfile ci(deps): update ci dependencies (#153) 2026-07-17 03:11:26 +00:00
LICENSE docs: add README.md and AGENTS.md (#49) 2026-06-20 14:20:10 +00:00
package.json chore(deps): update dependency rolldown to v1.2.0 (#158) 2026-07-18 17:19:45 +00:00
pnpm-lock.yaml chore(deps): update dependency rolldown to v1.2.0 (#158) 2026-07-18 17:19:45 +00:00
pnpm-workspace.yaml docs: add README.md and AGENTS.md (#49) 2026-06-20 14:20:10 +00:00
README.md fix: migrate to new projects org (#86) 2026-06-24 16:59:01 +00:00
rolldown.config.ts feat: refactor into a composite action (#12) 2026-06-18 11:48:11 +00:00
sea.json fix: migrate to new projects org (#86) 2026-06-24 16:59:01 +00:00
tsconfig.json feat: initial commit 2026-06-16 23:43:41 +02:00

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