1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-20 16:50:28 -05:00

chore(ci): Get Go binary from GOROOT instead of hardcoded path

This commit is contained in:
fnetX 2025-01-19 14:34:46 +00:00 committed by Otto Richter
parent ccaab19f1b
commit 11b9e0b60e

View file

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