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 b02e674
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,22 @@ inputs:
runs:
using: composite
steps:
- name: Get Go Version
shell: bash
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 b02e674

Please sign in to comment.