diff --git a/.forgejo/workflows-composite/setup-cache-go/action.yaml b/.forgejo/workflows-composite/setup-cache-go/action.yaml index 67372d9f36..3be61c9dc2 100644 --- a/.forgejo/workflows-composite/setup-cache-go/action.yaml +++ b/.forgejo/workflows-composite/setup-cache-go/action.yaml @@ -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}/go env GOMODCACHE')" >> "$GITHUB_OUTPUT" + echo "cache=$(su ${RUN_AS_USER} -c '${GOROOT}/go env GOCACHE')" >> "$GITHUB_OUTPUT" env: RUN_AS_USER: ${{ inputs.username }} GO_VERSION: ${{ steps.go-version.outputs.go-version }}