Install the fj CLI on a runner (checksum-pinned, from your Forgejo releases) and auth it with the workflow token. No github.com.
- Shell 88.5%
- Makefile 11.5%
The job token is scoped to this repo, so sending it on a cross-repo read of the public fj releases 404s. Releases are public, so try anonymously first and fall back to the token only for a private mirror. Fixes the e2e install. |
||
|---|---|---|
| .forgejo/workflows | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| action.yml | ||
| CHANGELOG.md | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
Setup fj
The fj CLI on your runner. Install a checksum-verified fj binary from
your own Forgejo releases, put it on PATH, and authenticate it with the
workflow's token, so any later step can fj pr, fj run, fj api, fj workflow run. No github.com.
Part of the Fjord Actions
bundle. The foundation the fj-CLI-native actions build on.
Usage
jobs:
orchestrate:
runs-on: [self-hosted, Linux]
steps:
- uses: https://rasterhub.com/rasterstate/setup-fj-action@v1
with:
version: latest # or a pinned tag like v0.1.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: fj pr list --json number,title
- run: fj workflow run deploy.yml --ref main
Inputs
| Input | Default | Description |
|---|---|---|
version |
latest |
fj tag to install, or latest. |
repository |
rasterstate/fj |
Repo publishing fj releases. |
download-base |
<server>/<repo>/releases/download |
Override the download base URL / mirror. |
authenticate |
true |
Run fj auth login with the token. |
host |
GITHUB_SERVER_URL host |
Forgejo host for fj. |
token |
GITHUB_TOKEN env |
Token for download (private repos) + auth. |
Outputs
| Output | Description |
|---|---|
version |
The fj version installed. |
Notes
- Releases are pulled from your Forgejo instance and verified against the
release's
SHA256SUMS. Supported platforms:linux-x86_64,darwin-aarch64,darwin-x86_64. - Auth is best-effort.
fj auth loginstores the token in the OS keychain; a keychain-less CI runner can't store it, so the action warns and continues (fj is still installed andFJ_HOSTis exported). On such runners, pass the token per command, or run on a host-mode runner with a keyring. The install itself always works.
License
MIT, see LICENSE.