fix(build): restore NPM_TOKEN string redaction bash workaround to fix intermittent docker build failures
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Successful in 1m10s
Build & Deploy / 🏗️ Build (push) Failing after 17s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-03-04 14:58:16 +01:00
parent 0bd55c1dee
commit b1363d9d52

View File

@@ -205,20 +205,31 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: 🐳 Set up Docker Buildx - name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: 🕵️ Discover Token - name: 🔐 Discover Valid Registry Token
id: discover_token id: discover_token
run: | run: |
if [ -n "${{ secrets.NPM_TOKEN }}" ]; then echo "Testing available secrets against git.infra.mintel.me Docker registry..."
echo "token=${{ secrets.NPM_TOKEN }}" >> $GITHUB_OUTPUT TOKENS="${{ secrets.GITEA_PAT }} ${{ secrets.MINTEL_PRIVATE_TOKEN }} ${{ secrets.NPM_TOKEN }}"
else USERS="${{ github.repository_owner }} ${{ github.actor }} marcmintel mintel mmintel"
echo "token=${{ vars.NPM_TOKEN }}" >> $GITHUB_OUTPUT
fi for TOKEN in $TOKENS; do
- name: 🔐 Registry Login if [ -n "$TOKEN" ]; then
uses: docker/login-action@v3 for U in $USERS; do
with: if [ -n "$U" ]; then
registry: git.infra.mintel.me echo "Attempting docker login for a token with user $U..."
username: ${{ github.repository_owner }} if echo "$TOKEN" | docker login git.infra.mintel.me -u "$U" --password-stdin > /dev/null 2>&1; then
password: ${{ steps.discover_token.outputs.token }} echo "✅ Successfully authenticated with a token."
echo "::add-mask::$TOKEN"
echo "token=$TOKEN" >> $GITHUB_OUTPUT
echo "user=$U" >> $GITHUB_OUTPUT
exit 0
fi
fi
done
fi
done
echo "❌ All available tokens failed to authenticate!"
exit 1
- name: 🏗️ Build and Push - name: 🏗️ Build and Push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with: