Skip to content

Commit 8855371

Browse files
chore(ci): fix docker login on nested e2e workflow (#2325)
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
1 parent 714f811 commit 8855371

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/e2e-reusable-pipeline.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,7 @@ jobs:
167167
echo "sha_short=$GIT_SHORT_HASH" >> $GITHUB_OUTPUT
168168
169169
REGISTRY=$(base64 -d <<< ${{secrets.PROD_IO_REGISTRY_DOCKER_CFG}} | jq '.auths | to_entries | .[] | .key' -r)
170-
USERNAME=$(base64 -d <<< ${{ secrets.PROD_IO_REGISTRY_DOCKER_CFG }} | jq '.auths | to_entries | .[] | .value.auth' -r | base64 -d | cut -d ':' -f1)
171-
PASSWORD=$(base64 -d <<< ${{ secrets.PROD_IO_REGISTRY_DOCKER_CFG }} | jq '.auths | to_entries | .[] | .value.auth' -r | base64 -d | cut -d ':' -f2)
172-
173170
echo "registry=$REGISTRY" >> $GITHUB_OUTPUT
174-
echo "username=$USERNAME" >> $GITHUB_OUTPUT
175-
echo "password=$PASSWORD" >> $GITHUB_OUTPUT
176171
177172
- name: Install htpasswd utility
178173
run: |
@@ -191,11 +186,14 @@ jobs:
191186
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
192187

193188
- name: Log in to private registry
194-
uses: docker/login-action@v3
195-
with:
196-
registry: ${{ steps.vars.outputs.registry }}
197-
username: ${{ steps.vars.outputs.username }}
198-
password: ${{ steps.vars.outputs.password }}
189+
env:
190+
REGISTRY: ${{ steps.vars.outputs.registry }}
191+
run: |
192+
USERNAME=$(base64 -d <<< "${{ secrets.PROD_IO_REGISTRY_DOCKER_CFG }}" | jq -r '.auths | to_entries | .[] | .value.auth' | base64 -d | cut -d ':' -f1)
193+
PASSWORD=$(base64 -d <<< "${{ secrets.PROD_IO_REGISTRY_DOCKER_CFG }}" | jq -r '.auths | to_entries | .[] | .value.auth' | base64 -d | cut -d ':' -f2)
194+
echo "::add-mask::$USERNAME"
195+
echo "::add-mask::$PASSWORD"
196+
echo "$PASSWORD" | docker login "$REGISTRY" --username "$USERNAME" --password-stdin
199197
200198
- name: Configure kubectl via azure/k8s-set-context@v4
201199
uses: azure/k8s-set-context@v4

0 commit comments

Comments
 (0)