mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-15 11:13:09 -06:00
0d7c718263
GitHub has deprecated this in favor of appending to a temporary file instead: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
27 lines
1.0 KiB
YAML
27 lines
1.0 KiB
YAML
# Copyright (c) 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"
|