Skip to content

Commit 9255827

Browse files
committed
- Enhanced setup-go action to allow optional explicit Go version input, overriding go.mod detection.
- Updated `release.yml` to use Go version `1.25.6`.
1 parent d62110f commit 9255827

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

.github/actions/setup-go/action.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Setup Go from go.mod
22
description: 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: ""
38
outputs:
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

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ docs/new-feature*
4040
plans/
4141
CLAUDE.md
4242
.claude/
43+
.codex
44+
.agents
45+
AGENTS.md

0 commit comments

Comments
 (0)