Files
actions/go-build
Ismo Vuorinen a527aa4fee refactor: inline Go detection into go-build
Make go-build self-contained by inlining Go version detection logic,
eliminating dependency on language-version-detect action.

Changes:
- Replace external language-version-detect call with inline script (~102 lines)
- Detect Go version from: .tool-versions, Dockerfile, devcontainer.json, .go-version, go.mod
- Use POSIX sh for maximum compatibility
- Maintain same output contract (detected-version)
- Fix sed to use POSIX-compliant extended regex (-E flag)
- Fix go.mod parsing to clean version before validation

Benefits:
- Faster execution (no external action overhead)
- Self-contained action
- Reduced attack surface
- Template for other language actions

This is part of Phase 1 of the inlining campaign to improve performance
and reduce internal dependencies.
2025-11-20 09:42:12 +02:00
..

ivuorinen/actions/go-build

Go Build

Description

Builds the Go project.

Inputs

name description required default
go-version

Go version to use.

false ""
destination

Build destination directory.

false ./bin
max-retries

Maximum number of retry attempts for go mod download operations

false 3
token

GitHub token for authentication

false ""

Outputs

name description
build_status

Build completion status (success/failure)

test_status

Test execution status (success/failure/skipped)

go_version

Version of Go used

binary_path

Path to built binaries

coverage_path

Path to coverage report

Runs

This action is a composite action.

Usage

- uses: ivuorinen/actions/go-build@main
  with:
    go-version:
    # Go version to use.
    #
    # Required: false
    # Default: ""

    destination:
    # Build destination directory.
    #
    # Required: false
    # Default: ./bin

    max-retries:
    # Maximum number of retry attempts for go mod download operations
    #
    # Required: false
    # Default: 3

    token:
    # GitHub token for authentication
    #
    # Required: false
    # Default: ""