Skip to content

Commit 8797e11

Browse files
committed
Store Go version as a step output
This changes from using an environment variable to using a step output to store the Go version that is installed. This mirrors changes made to the other program versions and how they're stored.
1 parent 2699e09 commit 8797e11

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
uses: actions/setup-python@v2
2525
with:
2626
python-version: 3.9
27-
# GO_VERSION and GOCACHE are used by the cache task, so the Go
28-
# installation must happen before that.
27+
# We need the Go version and Go cache location for the actions/cache step,
28+
# so the Go installation must happen before that.
2929
- uses: actions/setup-go@v2
3030
with:
3131
go-version: '1.16'
3232
- name: Store installed Go version
33+
id: go-version
3334
run: |
34-
echo "GO_VERSION="\
35-
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')" \
36-
>> $GITHUB_ENV
35+
echo "::set-output name=version::"\
36+
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')"
3737
- name: Lookup Go cache directory
3838
id: go-cache
3939
run: |
@@ -42,7 +42,7 @@ jobs:
4242
env:
4343
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
4444
py${{ steps.setup-python.outputs.python-version }}-\
45-
go${{ env.GO_VERSION }}-\
45+
go${{ steps.go-version.outputs.version }}-\
4646
packer${{ steps.setup-env.outputs.packer-version }}-\
4747
tf${{ steps.setup-env.outputs.terraform-version }}-"
4848
with:

0 commit comments

Comments
 (0)