mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 16:31:10 -06:00
cb2e9119aa
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
29 lines
1.1 KiB
YAML
29 lines
1.1 KiB
YAML
# Copyright (c) The OpenTofu Authors
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
# Copyright (c) 2023 HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
name: 'Determine Go Toolchain Version'
|
|
description: 'Uses the .go-version file to determine which Go toolchain to use for any Go-related actions downstream.'
|
|
outputs:
|
|
version:
|
|
description: "Go toolchain version"
|
|
value: ${{ steps.go.outputs.version }}
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
# We use goenv to make sure we're always using the same Go version we'd
|
|
# use for releases, as recorded in the .go-version file.
|
|
- name: "Determine Go version"
|
|
id: go
|
|
shell: bash
|
|
# We use .go-version as our source of truth for current Go
|
|
# version, because "goenv" can react to it automatically.
|
|
# However, we don't actually use goenv for our automated
|
|
# steps in GitHub Actions, because it's primarily for
|
|
# interactive use in shells and makes things unnecessarily
|
|
# complex for automation.
|
|
run: |
|
|
echo "Building with Go $(cat .go-version)"
|
|
echo "version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|