diff --git a/actions/docker-multiple-login-develop/action.yml b/actions/docker-multiple-login-develop/action.yml index a23606f..3420fd1 100644 --- a/actions/docker-multiple-login-develop/action.yml +++ b/actions/docker-multiple-login-develop/action.yml @@ -128,14 +128,32 @@ runs: username: ${{ inputs.azure-client-id }} password: ${{ inputs.azure-client-secret }} + # _json_key_base64 is not supported so we must convert it + - name: GCR Keys + if: ${{ inputs.gcr-json-key-base64 }} + run: | + echo "$GCR_JSON_KEY_BASE64" | base64 --decode >> .gcr-key + while read -r line; + do + echo "::add-mask::${line}" + done <<< "$(cat .gcr-key)" + echo "GCR_JSON_KEY<> $GITHUB_ENV + cat .gcr-key >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + # clean up + rm .gcr-key + shell: bash + env: + GCR_JSON_KEY_BASE64: ${{ inputs.gcr-json-key-base64 }} + # https://github.com/docker/login-action#google-container-registry-gcr - name: Login to Google Container Registry (GCR) uses: docker/login-action@v1 if: ${{ inputs.gcr-json-key-base64 }} with: registry: gcr.io - username: _json_key_base64 - password: ${{ inputs.gcr-json-key-base64 }} + username: _json_key + password: ${{ env.GCR_JSON_KEY }} # https://github.com/docker/login-action#google-artifact-registry-gar - name: Login to Google Artifact Registry (GAR)