Forgejo drop-in for actions/stale: mark and close stale issues and PRs via the Forgejo API. No github.com.
  • JavaScript 80.7%
  • Shell 13.8%
  • Makefile 5.5%
Find a file
Stephen Way 7a0fc23b36
All checks were successful
test / unit (push) Successful in 5s
Initial release: forgejo-stale-action
Mark issues and PRs stale after inactivity and close them after a
further period, via the Forgejo API. A drop-in for actions/stale with no
github.com. Inactivity measured by updated_at; exempt-labels/only-labels
filtering; operations-per-run cap; dry-run. Auto-creates the stale label.

node20 action with a pure decision core. Offline suite: a decision unit
test plus an integration run against an in-memory mock (stale/close/
fresh/exempt/PR/dry-run).
2026-05-31 20:06:43 -07:00
.forgejo/workflows Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
src Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
tests Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
.gitignore Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
action.yml Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
CHANGELOG.md Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
LICENSE Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
Makefile Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
MIGRATION.md Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
README.md Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00

Forgejo Stale

Forgejo's actions/stale. Mark issues and pull requests stale after a period of inactivity, then close them after a further period, via the Forgejo API. No github.com.

Part of the Fjord Actions bundle.

Usage

# .forgejo/workflows/stale.yml
on:
  schedule:
    - cron: '0 3 * * *'      # nightly
  workflow_dispatch:

permissions:
  issues: write
  pull-requests: write

jobs:
  stale:
    runs-on: [self-hosted, Linux]
    steps:
      - uses: https://rasterhub.com/rasterstate/forgejo-stale-action@v1
        with:
          days-before-stale: 60
          days-before-close: 7
          stale-issue-message: 'No activity for 60 days; marking stale. It will close in 7 days without further activity.'
          close-issue-message: 'Closing after 7 days stale. Comment to reopen.'
          exempt-labels: pinned, security
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}   # a Forgejo token on Forgejo

Run it on a schedule. Use dry-run: true first to see what it would do.

Inputs

Input Default Description
days-before-stale 60 Days of inactivity before marking stale.
days-before-close 7 Days after staling before closing. -1 to never close.
stale-label stale Label used to mark stale (created if missing).
stale-issue-message / stale-pr-message Comment posted when marking stale.
close-issue-message / close-pr-message Comment posted when closing.
exempt-labels Items with any of these labels are skipped.
only-labels Only consider items carrying ALL of these labels.
operations-per-run 100 Cap on state-changing operations per run.
dry-run false Log decisions without changing anything.
token GITHUB_TOKEN env Forgejo token with issues + PR write.
repository GITHUB_REPOSITORY Target repo.
api_url derived Forgejo API base.

Outputs

Output Description
staled Items marked stale this run.
closed Items closed this run.

See MIGRATION.md for differences from actions/stale.

License

MIT, see LICENSE.