No description
  • Shell 91.9%
  • Makefile 8.1%
Find a file
Stephen Way e2306570e6
Some checks are pending
test / unit (push) Waiting to run
test / install (1.22.0) (push) Waiting to run
test / install (stable) (push) Waiting to run
test / version-file-and-cache (push) Waiting to run
Repoint references from rasterstate to fjord org
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.
2026-06-03 16:17:08 -07:00
.forgejo Add Forgejo-compatible setup-go action 2026-05-28 09:20:28 -07:00
.githooks Add Forgejo-compatible setup-go action 2026-05-28 09:20:28 -07:00
examples/workflows Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00
scripts Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00
tests Add Forgejo-compatible setup-go action 2026-05-28 09:20:28 -07:00
.editorconfig Add Forgejo-compatible setup-go action 2026-05-28 09:20:28 -07:00
.gitignore Add Forgejo-compatible setup-go action 2026-05-28 09:20:28 -07:00
action.yml Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00
CHANGELOG.md Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00
CONTRIBUTING.md Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00
LICENSE Add Forgejo-compatible setup-go action 2026-05-28 09:20:28 -07:00
Makefile Add Forgejo-compatible setup-go action 2026-05-28 09:20:28 -07:00
MIGRATION.md Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00
README.md Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00
SECURITY.md Repoint references from rasterstate to fjord org 2026-06-03 16:17:08 -07:00

setup-go-action

test

Install Go on Forgejo Actions runners from the official distribution (or a mirror you choose), and cache the module + build caches through fjord/cache-action. A port of actions/setup-go with no GitHub cache services and no PAT. Composite action, pure shell, no build step.

Quick start

jobs:
  test:
    runs-on: [self-hosted, Linux]
    env:
      # Only needed because cache defaults to true (drives cache-action).
      RASTER_CACHE_S3_BUCKET: ci-cache
      RASTER_CACHE_S3_ENDPOINT: https://fsn1.your-objectstorage.com
      RASTER_CACHE_S3_REGION: fsn1
      RASTER_CACHE_S3_ACCESS_KEY_ID: ${{ secrets.CACHE_S3_KEY_ID }}
      RASTER_CACHE_S3_SECRET_ACCESS_KEY: ${{ secrets.CACHE_S3_SECRET }}
    steps:
      - uses: actions/checkout@v6
      - uses: https://rasterhub.com/fjord/setup-go-action@v1
        with:
          go-version-file: go.mod
      - run: go build ./...
      - run: go test ./...

Inputs

Mirror actions/setup-go.

Input Default Description
go-version Exact (1.22.0), major.minor (1.22), stable, or oldstable.
go-version-file go.mod (uses the toolchain/go line) or .go-version. Auto-detects go.mod.
architecture runner arch amd64 or arm64.
cache true Cache module + build caches via cache-action.
cache-dependency-path go.sum + go.mod Files to hash for the key, one per line.
check-latest false Accepted; resolution always queries the live listing.
go-mirror https://go.dev/dl Distribution base URL (point at a mirror for air-gapped runners).

Outputs

Output Description
go-version Resolved version installed (with leading go).
cache-hit Exact cache match (empty when cache is disabled).

How it works

  • Install: resolves the version against the go.dev/dl JSON listing, downloads goX.Y.Z.<os>-<arch>.tar.gz, verifies it against the sha256 from that listing, installs into the runner tool cache, and sets GOROOT plus PATH (including GOPATH/bin). No GitHub API, no GitHub Releases.
  • Cache: when cache: true, a step resolves GOMODCACHE and GOCACHE and a go.sum-hash key, then a nested fjord/cache-action step restores and (in the job post step) saves them. This needs a configured cache backend (RASTER_CACHE_*).

Private modules and Forgejo-hosted repos

Set GOPRIVATE / GONOSUMDB and configure git auth for your Forgejo host, then run as usual:

- uses: https://rasterhub.com/fjord/setup-go-action@v1
  with:
    go-version: '1.22'
- run: go build ./...
  env:
    GOPRIVATE: rasterhub.com/*
    GIT_CONFIG_COUNT: '1'
    GIT_CONFIG_KEY_0: url.https://${{ secrets.FORGEJO_TOKEN }}@rasterhub.com/.insteadOf
    GIT_CONFIG_VALUE_0: https://rasterhub.com/

Version resolution scope

Exact, major.minor (latest patch), stable, and oldstable. The go.mod toolchain line is used when present, otherwise the go directive. See MIGRATION.md.

Examples

See examples/workflows.

License

MIT. See LICENSE.