docker: inject GH_TOKEN via BuildKit secret for private mod download

luxfi/corona went private; the Dockerfile builder's `go mod download`
was failing with "could not read Username for 'https://github.com'"
on the ARC runner. Adds a BuildKit secret mount (required=false so
local builds without the secret still work when all deps are public)
and rewrites `git config url.insteadOf` to inject the token only for
the download step. Token is unset after to keep the layer clean.

The workflow passes ${{ secrets.GITHUB_TOKEN }} as the `ghtok` secret;
the default GITHUB_TOKEN has repo:read for the runner's repository,
which is sufficient for luxfi/corona since it's in the same org.
This commit is contained in:
Hanzo AI
2026-05-21 17:28:07 -07:00
parent a94d1f9a62
commit f14e7723b0
2 changed files with 14 additions and 2 deletions
+2
View File
@@ -52,6 +52,8 @@ jobs:
push: true
build-args: |
CGO_ENABLED=0
secrets: |
ghtok=${{ secrets.GITHUB_TOKEN }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false