fix(ci): harbor login mangled username and added newline to password
Pass HARBOR_USERNAME/HARBOR_PASSWORD via env: instead of inlining
${{ secrets.* }} directly into the shell — bash was expanding the `$`
in the robot username (e.g. `robot$kollect-tools+...` lost the
`$kollect-tools` segment). Switched echo to printf to avoid appending a
newline to --password-stdin.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
main
parent
8376250940
commit
a2e78b8fbd
|
|
@ -67,10 +67,17 @@ jobs:
|
|||
echo "tag_latest=${IMAGE_NAME}:latest" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Login to Harbor
|
||||
# Pass secrets via env (not ${{ }} inlining) so shell quoting can't
|
||||
# mangle them — e.g. a literal `$` in the robot username would be
|
||||
# expanded by bash if inlined inside double quotes. printf (not echo)
|
||||
# avoids appending a newline to the password sent to --password-stdin.
|
||||
env:
|
||||
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
|
||||
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
|
||||
run: |
|
||||
echo "${{ secrets.HARBOR_PASSWORD }}" \
|
||||
| docker login "${{ env.HARBOR_REGISTRY }}" \
|
||||
-u "${{ secrets.HARBOR_USERNAME }}" \
|
||||
printf '%s' "$HARBOR_PASSWORD" \
|
||||
| docker login "$HARBOR_REGISTRY" \
|
||||
-u "$HARBOR_USERNAME" \
|
||||
--password-stdin
|
||||
|
||||
- name: Build image
|
||||
|
|
|
|||
Loading…
Reference in New Issue