Forgejo drop-in for softprops/action-gh-release: create or update a release and upload assets via the Forgejo API. No github.com.
  • JavaScript 78.1%
  • Shell 17.2%
  • Makefile 4.7%
Find a file
Stephen Way 3b400b01e3
All checks were successful
test / unit (push) Successful in 5s
tests: clear ambient GITHUB_TOKEN for the missing-token case
The Forgejo runner injects GITHUB_TOKEN into every job, so the no-token
path has to be exercised with GITHUB_TOKEN/FORGEJO_TOKEN explicitly
unset. The action's behaviour (use the ambient token) was correct; only
the test's assumption was wrong.
2026-05-31 19:43:00 -07:00
.forgejo/workflows Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
src Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
tests tests: clear ambient GITHUB_TOKEN for the missing-token case 2026-05-31 19:43:00 -07:00
.gitignore Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
action.yml Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
CHANGELOG.md Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
LICENSE Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
Makefile Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
MIGRATION.md Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00
README.md Initial release: forgejo-release-action 2026-05-31 19:36:52 -07:00

Forgejo Release

Forgejo's missing softprops/action-gh-release. Create or update a release for a tag and upload asset files, all through the Forgejo API. No github.com, no hand-rolled curl.

Part of the Fjord Actions bundle.

Why

Forgejo has a perfectly good release API, but the popular release actions (softprops/action-gh-release, ncipollo/release-action, actions/create-release) all talk to api.github.com, so on Forgejo you end up hand-writing curl against /api/v1/.../releases to find-or-create a release and upload each asset. This action does that for you with the same with: surface you already know.

Usage

on:
  push:
    tags: ['v*']

permissions:
  contents: write

jobs:
  release:
    runs-on: [self-hosted, Linux]
    steps:
      - uses: actions/checkout@v6
      - run: make dist            # produces dist/*.tar.gz, dist/SHA256SUMS

      - uses: https://rasterhub.com/rasterstate/forgejo-release-action@v1
        with:
          # tag_name defaults to the pushed tag; name defaults to the tag.
          body_path: CHANGELOG-latest.md
          files: |
            dist/*.tar.gz
            dist/SHA256SUMS
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}   # a Forgejo token on Forgejo

The Forgejo runner's secrets.GITHUB_TOKEN is a Forgejo token, so it authenticates against your instance. Pass it as the GITHUB_TOKEN env (shown) or the token input. Needs contents: write.

Inputs

Input Default Description
tag_name pushed tag Tag for the release.
name tag Release title.
body Release notes (markdown).
body_path File to read notes from. Takes precedence over body.
draft false Create as a draft.
prerelease false Mark as a prerelease.
target_commitish GITHUB_SHA Commitish the tag is cut from if it doesn't exist.
files Asset paths/globs, one per line (e.g. dist/*.tar.gz).
overwrite_files true Replace an existing asset of the same name.
fail_on_unmatched_files false Fail if a files pattern matches nothing.
repository GITHUB_REPOSITORY Target repo as owner/name.
api_url GITHUB_API_URL, then GITHUB_SERVER_URL+/api/v1 Forgejo API base.
token GITHUB_TOKEN / FORGEJO_TOKEN env Forgejo token with repo write.

Outputs

Output Description
id The release id.
tag_name The release tag.
url The release web URL.
assets JSON array of uploaded assets (name, id, url).

Globs

files supports * (within a path segment), ?, ** (across segments), and literal paths. One pattern per line. Brace and extglob are not supported, list multiple lines instead.

License

MIT, see LICENSE. See MIGRATION.md for differences from softprops/action-gh-release.