smith: reusable AI jobs for Forgejo #3

Merged
noe.trevino merged 1 commit from smith into main 2026-10-03 13:49:45 -05:00
Owner

Replaces the four claude-*.yml copies (they use anthropics/claude-code-action, which only works with GitHub) with one reusable workflow, .forgejo/workflows/smith.yml, and the Forgejo API client smith/forge.

Each job is off until the caller turns it on: pr-labels, pr-description, pr-closer, issue-labels, review, mention (@smith). See the README.

Tested in noe.trevino/smith-test:

  • issue #4: issue-labels added documentation
  • PR #5: pr-labels, pr-description, pr-closer (Closes #1), review (2 inline comments, 3/10)
  • PR #5 comment @smith: fixed the code and pushed 8e9fb7d
  • issue #4 comment @smith: branch smith/issue-4, PR #6
  • PR #6 inline review comment @smith: pushed fef24ec

Unit tests for forge: smith-test.yml (passes).

Replaces the four `claude-*.yml` copies (they use `anthropics/claude-code-action`, which only works with GitHub) with one reusable workflow, `.forgejo/workflows/smith.yml`, and the Forgejo API client `smith/forge`. Each job is off until the caller turns it on: `pr-labels`, `pr-description`, `pr-closer`, `issue-labels`, `review`, `mention` (`@smith`). See the README. Tested in `noe.trevino/smith-test`: - issue #4: `issue-labels` added `documentation` - PR #5: `pr-labels`, `pr-description`, `pr-closer` (`Closes #1`), `review` (2 inline comments, 3/10) - PR #5 comment `@smith`: fixed the code and pushed `8e9fb7d` - issue #4 comment `@smith`: branch `smith/issue-4`, PR #6 - PR #6 inline review comment `@smith`: pushed `fef24ec` Unit tests for `forge`: `smith-test.yml` (passes).
smith: reusable AI jobs for Forgejo, with a Forgejo API client
All checks were successful
Smith tests / unit (pull_request) Successful in 3s
024d635585
Replaces the claude-code-action copies, which only work with GitHub. The jobs
run the Claude Code CLI and act as the smith account. Each job is off until
the caller turns it on: pr-labels, pr-description, pr-closer, issue-labels,
review (inline comments), mention (@smith; answers and pushes changes, opens
a PR for an issue).

smith/forge is the API client for the jobs and the agent: labels, issues,
PRs, numbered diffs, comments, access checks, and reviews whose inline
comments are checked against the diff before they are posted.

Forgejo notes, handled in the workflow:
- In a called workflow github.event_name is "workflow_call", so the jobs
  tell the events apart by the payload.
- A review event does not carry the text of its inline comments, so the
  mention gate reads them through the API.
- github.server_url is the runner's address; links use the public one.
Sign in to join this conversation.
No description provided.