- JavaScript 78.1%
- Shell 17.2%
- Makefile 4.7%
|
Some checks are pending
test / unit (push) Waiting to run
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. |
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| action.yml | ||
| CHANGELOG.md | ||
| LICENSE | ||
| Makefile | ||
| MIGRATION.md | ||
| README.md | ||
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/fjord/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.