fix: bypass docker login, write auth config directly
Docker credential helper on the runner may interfere with login. Write base64 credentials to ~/.docker/config.json directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: |
|
- run: |
|
||||||
podman run --rm \
|
docker run --rm \
|
||||||
-v "$PWD:/scan:ro" \
|
-v "$PWD:/scan:ro" \
|
||||||
ghcr.io/gitleaks/gitleaks:latest \
|
ghcr.io/gitleaks/gitleaks:latest \
|
||||||
detect --source /scan -v
|
detect --source /scan -v
|
||||||
@@ -33,9 +33,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: echo "$HARBOR_PASS" | podman login harbor.mymx.me -u "$HARBOR_USER" --password-stdin
|
- run: |
|
||||||
|
mkdir -p ~/.docker
|
||||||
|
AUTH=$(printf '%s:%s' "$HARBOR_USER" "$HARBOR_PASS" | base64 -w0)
|
||||||
|
printf '{"auths":{"harbor.mymx.me":{"auth":"%s"}}}\n' "$AUTH" > ~/.docker/config.json
|
||||||
env:
|
env:
|
||||||
HARBOR_USER: ${{ secrets.HARBOR_USER }}
|
HARBOR_USER: ${{ secrets.HARBOR_USER }}
|
||||||
HARBOR_PASS: ${{ secrets.HARBOR_PASS }}
|
HARBOR_PASS: ${{ secrets.HARBOR_PASS }}
|
||||||
- run: podman build -t harbor.mymx.me/s5p/s5p:latest -f Containerfile .
|
- run: docker build -t harbor.mymx.me/s5p/s5p:latest -f Containerfile .
|
||||||
- run: podman push harbor.mymx.me/s5p/s5p:latest
|
- run: docker push harbor.mymx.me/s5p/s5p:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user