Forgejo drop-in for actions/stale: mark and close stale issues and PRs via the Forgejo API. No github.com.
  • JavaScript 79.2%
  • Shell 15.5%
  • Makefile 5.3%
Find a file
Stephen Way a1cc30b010
All checks were successful
test / unit (push) Successful in 4s
Paginate stale label lookup (#1)
2026-06-08 05:15:47 +00:00
.forgejo/workflows Initial release: forgejo-stale-action 2026-05-31 20:06:43 -07:00
src Paginate stale label lookup (#1) 2026-06-08 05:15:47 +00:00
tests Paginate stale label lookup (#1) 2026-06-08 05:15:47 +00: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.