Action that runs Pi agent in Forgejo CI when commenting with a reference to an llm bot
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Renovate [bot] 11bedfab94
All checks were successful
release.yaml / Generate next release tag (push) Successful in 4s
ci(deps): update ci dependencies (#267)
2026-09-09 03:14:40 +00:00
.devcontainer ci(deps): update ci dependencies (#267) 2026-09-09 03:14:40 +00:00
.forgejo ci(deps): update ci dependencies (#267) 2026-09-09 03:14:40 +00:00
examples/event_payloads feat: add close and create issue tools (#19) 2026-06-18 18:32:35 +00:00
src test: add unit tests with vitest (#265) 2026-09-08 20:42:02 +00:00
test Revert "test(integration): add integration tests against a real forgejo instance" 2026-09-08 21:06:01 +00:00
.gitignore Revert "test(integration): add integration tests against a real forgejo instance" 2026-09-08 21:06:01 +00:00
.prettierignore Revert "test(integration): add integration tests against a real forgejo instance" 2026-09-08 21:06:01 +00:00
.prettierrc.json docs: add README.md and AGENTS.md (#49) 2026-06-20 14:20:10 +00:00
.releaserc.json feat: enable forgejo releases (#229) 2026-08-27 09:49:54 +00:00
.renovaterc.jsonc chore: use pnpm ci image (#242) 2026-08-30 10:46:36 +00:00
.yamllint.yaml fix: replace tag in action.yaml on release 2026-06-17 18:33:54 +02:00
action.yaml chore(release): v1.9.12 2026-09-08 16:00:43 +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.12 (#257) 2026-09-07 03:11:57 +00:00
LICENSE docs: add README.md and AGENTS.md (#49) 2026-06-20 14:20:10 +00:00
package.json Revert "test(integration): add integration tests against a real forgejo instance" 2026-09-08 21:06:01 +00:00
pnpm-lock.yaml test: add unit tests with vitest (#265) 2026-09-08 20:42:02 +00:00
pnpm-workspace.yaml fix(deps): update dependency @earendil-works/pi-coding-agent to v0.85.0 (#261) 2026-09-08 16:00:39 +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
vitest.config.ts Revert "test(integration): add integration tests against a real forgejo instance" 2026-09-08 21:06:01 +00: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