mirror of
1
Fork 0

[v10.0/forgejo] chore(ci): Get Go binary from GOROOT instead of hardcoded path (#7073)

Backport: https://codeberg.org/forgejo/forgejo/pulls/6590
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7073
Reviewed-by: Otto <otto@codeberg.org>
This commit is contained in:
Earl Warren 2025-02-28 15:36:13 +00:00
parent c7bd6f4a3d
commit 6fcb8f646f
1 changed files with 3 additions and 2 deletions

View File

@ -27,8 +27,9 @@ runs:
- name: "Get go environment information"
id: go-environment
run: |
echo "modcache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT"
echo "cache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT"
export GOROOT="$(go env GOROOT)"
echo "modcache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT"
echo "cache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT"
env:
RUN_AS_USER: ${{ inputs.username }}
GO_VERSION: ${{ steps.go-version.outputs.go-version }}