fix(ci): separate git credentials from --git-repo URL to fix tea pr create #40

Merged
kacerr merged 1 commits from fix/gitops-tea-url into main 2026-06-12 19:39:31 +02:00

View File

@@ -71,10 +71,15 @@ jobs:
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT" echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"
echo "Resolved image: ${IMAGE}" echo "Resolved image: ${IMAGE}"
- name: Configure git identity - name: Configure git identity and credentials
run: | run: |
git config --global user.name "uh-cli bot" git config --global user.name "uh-cli bot"
git config --global user.email "bot@hrajfrisbee.cz" git config --global user.email "bot@hrajfrisbee.cz"
# Store credentials separately so the --git-repo URL stays clean.
# Tea matches the login URL against the remote URL; embedded credentials
# break that matching and cause "path segment [0] is empty" on pr create.
git config --global credential.helper store
echo "https://kacerr:${GITEA_TOKEN}@gitea.home.hrajfrisbee.cz" >> ~/.git-credentials
- name: Authenticate tea - name: Authenticate tea
run: | run: |
@@ -85,10 +90,11 @@ jobs:
- name: Open image-update PR (or dry run) - name: Open image-update PR (or dry run)
run: | run: |
set -x
uh-cli -v gitops deployment update \ uh-cli -v gitops deployment update \
--deployment-name fuj-management \ --deployment-name fuj-management \
--deployment-namespace fuj \ --deployment-namespace fuj \
--set-image "${{ steps.resolve.outputs.image }}" \ --set-image "${{ steps.resolve.outputs.image }}" \
--git-repo "https://kacerr:${GITEA_TOKEN}@gitea.home.hrajfrisbee.cz/kacerr/home-kubernetes" \ --git-repo "https://gitea.home.hrajfrisbee.cz/kacerr/home-kubernetes" \
--git-path gitops/home-kubernetes \ --git-path gitops/home-kubernetes \
${{ (github.event_name == 'workflow_dispatch' && inputs.dry_run == 'true') && '--dry-run' || '' }} ${{ (github.event_name == 'workflow_dispatch' && inputs.dry_run == 'true') && '--dry-run' || '' }}