Forgejo drop-in for actions/labeler: label PRs by changed-file globs from a config file, via the Forgejo API. No github.com.
  • JavaScript 82.3%
  • Shell 13.1%
  • Makefile 4.6%
Find a file
Stephen Way 8f4ea923f6
Some checks are pending
test / unit (push) Waiting to run
Repoint references from rasterstate to fjord org
Org migration: the action family now lives under fjord/. Repoints internal repo references (uses:, CI badges, docs, migration guides) at fjord/ and sets the action author to fjord. The old rasterstate copies are left in place.
2026-06-03 16:16:57 -07:00
.forgejo Initial release: forgejo-labeler-action 2026-05-31 20:13:11 -07:00
src Initial release: forgejo-labeler-action 2026-05-31 20:13:11 -07:00
tests Initial release: forgejo-labeler-action 2026-05-31 20:13:11 -07:00
.gitignore Initial release: forgejo-labeler-action 2026-05-31 20:13:11 -07:00
action.yml Repoint references from rasterstate to fjord org 2026-06-03 16:16:57 -07:00
CHANGELOG.md Initial release: forgejo-labeler-action 2026-05-31 20:13:11 -07:00
LICENSE Initial release: forgejo-labeler-action 2026-05-31 20:13:11 -07:00
Makefile Initial release: forgejo-labeler-action 2026-05-31 20:13:11 -07:00
MIGRATION.md Repoint references from rasterstate to fjord org 2026-06-03 16:16:57 -07:00
README.md Repoint references from rasterstate to fjord org 2026-06-03 16:16:57 -07:00

Forgejo Labeler

Forgejo's actions/labeler. Apply labels to a pull request based on which files it changes, matched against a config of label -> glob patterns, via the Forgejo API. No github.com.

Part of the Fjord Actions bundle.

Usage

.forgejo/labeler.yml:

frontend:
  - 'web/**'
  - '**/*.css'
docs:
  - 'docs/**'
  - '**/*.md'
ci:
  - '.forgejo/**'

Workflow:

on:
  pull_request:

permissions:
  pull-requests: write

jobs:
  label:
    runs-on: [self-hosted, Linux]
    steps:
      - uses: actions/checkout@v6
      - uses: https://rasterhub.com/fjord/forgejo-labeler-action@v1
        with:
          sync-labels: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}   # a Forgejo token on Forgejo

Config

A flat map of label -> glob patterns. A label applies when any of its patterns matches any changed file in the PR. YAML (indented list or inline array) and JSON both work:

docs: ['docs/**', '*.md']     # inline array
ci: '.forgejo/**'             # single value

Globs support * (within a path segment), ?, ** (across segments), and literal paths. Nested matcher objects (any-glob-to-any-file, all-globs-to-...) are not supported, use flat glob lists.

Inputs

Input Default Description
configuration-path .forgejo/labeler.yml Path to the label -> globs config.
sync-labels false Remove configured labels that no longer match.
pr-number from context PR to label (defaults to the event's pull_request).
token GITHUB_TOKEN env Forgejo token with PR write.
repository GITHUB_REPOSITORY Target repo.
api_url derived Forgejo API base.

Outputs

Output Description
new-labels JSON array of labels added this run.
all-labels JSON array of the PR's labels after this run.

Labels referenced in the config that don't exist yet are created automatically.

See MIGRATION.md for differences from actions/labeler.

License

MIT, see LICENSE.