# Tinqs Setup Go — replaces actions/setup-go@v5 # Original: https://github.com/actions/setup-go (GitHub-hosted, Node.js action) # Why rewritten: Original uses GitHub's tool cache API and Node.js runtime — neither # available on self-hosted Gitea runners. This composite action downloads Go directly # from go.dev and sets GITHUB_PATH. Skips install if correct version already present # (for when runner image has Go pre-baked). # Removed from original: tool cache, go-version-file, check-latest, cache (actions/cache dep). # Author: Ozan / Claude Code — 2026-05-22 # Part of: tinqs/ci (Tinqs CI toolchain) name: 'Tinqs Setup Go' description: 'Install Go and configure PATH (replaces actions/setup-go)' inputs: go-version: description: 'Go version to install' default: '1.26.2' runs: using: 'composite' steps: - run: | GO_VERSION="${{ inputs.go-version }}" # Skip if already installed at correct version if command -v go &>/dev/null; then CURRENT=$(go version | grep -oP '\d+\.\d+\.\d+' || true) if [ "$CURRENT" = "$GO_VERSION" ]; then echo "Go $GO_VERSION already installed" go version exit 0 fi fi echo "Installing Go $GO_VERSION..." curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xz echo "/usr/local/go/bin" >> "$GITHUB_PATH" export PATH="/usr/local/go/bin:$PATH" go version shell: bash