setup-go/action.yml
abdennour 74a1f88c58 feat: add support for custom go-download-site input
This adds a new `go-download-site` input parameter that allows users to specify a custom base URL for downloading Go distributions. This is particularly useful for GitHub Enterprise Server (GHES) environments, corporate proxies, or air-gapped setups where direct access to github.com is restricted.

Changes:
- Added `go-download-site` input to `action.yml` (default: `https://github.com`)
- Updated `installer.ts` to replace the default GitHub URL with the provided custom site URL
- Updated `main.ts` to pass the input to the installer
- Added documentation in `README.md` with examples for Artifactory and GHES proxies

Resolves #296
2025-11-29 20:44:19 +00:00

34 lines
1.8 KiB
YAML

name: 'Setup Go environment'
description: 'Setup a Go environment and add it to the PATH'
author: 'GitHub'
inputs:
go-version:
description: 'The Go version to download (if necessary) and use. Supports semver spec and ranges. Be sure to enclose this option in single quotation marks.'
go-version-file:
description: 'Path to the go.mod, go.work, .go-version, or .tool-versions file.'
check-latest:
description: 'Set this option to true if you want the action to always check for the latest available version that satisfies the version spec'
default: false
token:
description: Used to pull Go distributions from go-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
cache:
description: Used to specify whether caching is needed. Set to true, if you'd like to enable caching.
default: true
cache-dependency-path:
description: 'Used to specify the path to a dependency file - go.sum'
architecture:
description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.'
go-download-site:
description: 'Base URL for downloading Go distributions. Useful for GitHub Enterprise or when using a proxy/mirror. Defaults to https://github.com'
default: 'https://github.com'
outputs:
go-version:
description: 'The installed Go version. Useful when given a version range as input.'
cache-hit:
description: 'A boolean value to indicate if a cache was hit'
runs:
using: 'node20'
main: 'dist/setup/index.js'
post: 'dist/cache-save/index.js'
post-if: success()