File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Setup Go from go.mod
22description : Detect the Go toolchain version from go.mod and install it with caching enabled
3+ inputs :
4+ version :
5+ description : " Go version to use (overrides go.mod detection)"
6+ required : false
7+ default : " "
38outputs :
49 version :
510 description : Detected Go version
@@ -13,15 +18,20 @@ runs:
1318 run : |
1419 set -euo pipefail
1520
16- VERSION=""
17- TOOLCHAIN_VERSION=$(grep -E '^toolchain go[0-9]+\.[0-9]+(\.[0-9]+)?$' go.mod | cut -d ' ' -f 2 | sed 's/^go//' || true)
18- if [ -n "$TOOLCHAIN_VERSION" ]; then
19- VERSION="$TOOLCHAIN_VERSION"
20- echo "Detected toolchain directive: go$VERSION"
21+ if [ -n "${{ inputs.version }}" ]; then
22+ VERSION="${{ inputs.version }}"
23+ echo "Using provided version: go$VERSION"
2124 else
22- VERSION=$(grep -E '^go [0-9]+\.[0-9]+(\.[0-9]+)?$' go.mod | cut -d ' ' -f 2 || true)
23- if [ -n "$VERSION" ]; then
24- echo "Detected go directive: $VERSION"
25+ VERSION=""
26+ TOOLCHAIN_VERSION=$(grep -E '^toolchain go[0-9]+\.[0-9]+(\.[0-9]+)?$' go.mod | cut -d ' ' -f 2 | sed 's/^go//' || true)
27+ if [ -n "$TOOLCHAIN_VERSION" ]; then
28+ VERSION="$TOOLCHAIN_VERSION"
29+ echo "Detected toolchain directive: go$VERSION"
30+ else
31+ VERSION=$(grep -E '^go [0-9]+\.[0-9]+(\.[0-9]+)?$' go.mod | cut -d ' ' -f 2 || true)
32+ if [ -n "$VERSION" ]; then
33+ echo "Detected go directive: $VERSION"
34+ fi
2535 fi
2636 fi
2737
Original file line number Diff line number Diff line change 3333 - name : Setup Go
3434 id : setup-go
3535 uses : ./.github/actions/setup-go
36+ with :
37+ version : " 1.25.6"
3638
3739 - name : Prepare Build Variables
3840 id : vars
Original file line number Diff line number Diff line change @@ -40,3 +40,6 @@ docs/new-feature*
4040plans /
4141CLAUDE.md
4242.claude /
43+ .codex
44+ .agents
45+ AGENTS.md
You can’t perform that action at this time.
0 commit comments