Skip to content

Commit

Permalink
fix: install toolchain version if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt committed Dec 16, 2024
1 parent ab79b79 commit acd2f55
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,21 @@ inputs:
runs:
using: composite
steps:
- name: Get Go Version
id: go-version
run: |
version=$(sed -ne '/^toolchain /s/^toolchain go//p' ${{ inputs.go-version-file }})
if [ -z "$version" ]; then
version=$(sed -ne '/^go /s/^go //p' ${{ inputs.go-version-file }})
echo "Toolchain version not found in ${{ inputs.go-version-file }}, using go directive instead."
fi
echo "Go Version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Set up Go
uses: actions/[email protected]
with:
go-version-file: ${{ inputs.go-version-file }}
go-version: ${{ steps.go-version.outputs.version }}
cache: false
check-latest: true

Expand Down

0 comments on commit acd2f55

Please sign in to comment.