From 7d3848386070eb7c2ee8795077b5648ef81293d8 Mon Sep 17 00:00:00 2001 From: James712346 Date: Wed, 3 May 2023 22:23:00 +0800 Subject: [PATCH] Added `-w 0` to base64 command for credientals produce a base64 value larger than 76 charters (#25) If a username, and password that produces a base64 value larger than 76 characters, base64 will add \n to the output to wrap the text. The \n is then moved to the ~/.docker/config.json, that would break build image step producing the error of ``` WARNING: Error loading config file: /root/.docker/config.json: invalid character '\n' in string literal ``` Reviewed-on: https://gitea.com/gitea/test-env/pulls/25 Reviewed-by: techknowlogick Co-authored-by: James712346 Co-committed-by: James712346 --- .gitea/workflows/build-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build-publish.yaml b/.gitea/workflows/build-publish.yaml index e9ce5fb..66f8409 100644 --- a/.gitea/workflows/build-publish.yaml +++ b/.gitea/workflows/build-publish.yaml @@ -27,7 +27,7 @@ jobs: uses: https://github.com/docker/setup-buildx-action@v2 - name: login into docker hub run: | - BASE64_AUTH=`echo -n "$CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD" | base64` + BASE64_AUTH=`echo -n "$CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD" | base64 -w 0` mkdir -p ~/.docker echo "{\"auths\": {\"$CI_REGISTRY\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json env: