From 7437078f2302e0934f87f0eed938dbc36fd87e2c Mon Sep 17 00:00:00 2001 From: Story Crater Bot <19826264+Riotpiaole@users.noreply.github.com> Date: Fri, 17 Jul 2026 12:27:40 -0700 Subject: [PATCH] fix(ci): Correct Forgejo Actions template syntax for git clone auth Use proper Forgejo variables: gitea.server_url, gitea.repository Construct CLONE_URL correctly: https://user:token@host/repo.git Use bash parameter expansion to strip https:// prefix Removes invalid Forgejo filter syntax (| replace) --- .forgejo/workflows/argocd-sync.yaml | 8 +++++--- .forgejo/workflows/security-scan.yaml | 8 +++++--- .forgejo/workflows/validate-k8s.yaml | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/argocd-sync.yaml b/.forgejo/workflows/argocd-sync.yaml index 1bf5be2..02896c9 100644 --- a/.forgejo/workflows/argocd-sync.yaml +++ b/.forgejo/workflows/argocd-sync.yaml @@ -13,10 +13,12 @@ jobs: steps: - name: Checkout run: | - CLONE_URL="https://${{ secrets.CI_RUNNER }}:${{ secrets.CI_RUNNER_SECRET }}@${{ gitea.repository_clone_url | replace 'https://', '' }}" + REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" + CLONE_URL="https://${{ secrets.CI_RUNNER }}:${{ secrets.CI_RUNNER_SECRET }}@${REPO_URL#https://}" git clone --depth 1 "$CLONE_URL" . - git fetch origin ${{ gitea.ref }}:current-branch - git checkout current-branch + cd ${GITHUB_WORKSPACE} + git fetch origin main + git checkout main - name: Install ArgoCD CLI run: | diff --git a/.forgejo/workflows/security-scan.yaml b/.forgejo/workflows/security-scan.yaml index dfbffd9..047834f 100644 --- a/.forgejo/workflows/security-scan.yaml +++ b/.forgejo/workflows/security-scan.yaml @@ -17,10 +17,12 @@ jobs: steps: - name: Checkout run: | - CLONE_URL="https://${{ secrets.CI_RUNNER }}:${{ secrets.CI_RUNNER_SECRET }}@${{ gitea.repository_clone_url | replace 'https://', '' }}" + REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" + CLONE_URL="https://${{ secrets.CI_RUNNER }}:${{ secrets.CI_RUNNER_SECRET }}@${REPO_URL#https://}" git clone --depth 1 "$CLONE_URL" . - git fetch origin ${{ gitea.ref }}:current-branch - git checkout current-branch + cd ${GITHUB_WORKSPACE} + git fetch origin main + git checkout main - name: Install Tools run: | diff --git a/.forgejo/workflows/validate-k8s.yaml b/.forgejo/workflows/validate-k8s.yaml index f346a6b..1e449ee 100644 --- a/.forgejo/workflows/validate-k8s.yaml +++ b/.forgejo/workflows/validate-k8s.yaml @@ -19,10 +19,12 @@ jobs: steps: - name: Checkout run: | - CLONE_URL="https://${{ secrets.CI_RUNNER }}:${{ secrets.CI_RUNNER_SECRET }}@${{ gitea.repository_clone_url | replace 'https://', '' }}" + REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" + CLONE_URL="https://${{ secrets.CI_RUNNER }}:${{ secrets.CI_RUNNER_SECRET }}@${REPO_URL#https://}" git clone --depth 1 "$CLONE_URL" . - git fetch origin ${{ gitea.ref }}:current-branch - git checkout current-branch + cd ${GITHUB_WORKSPACE} + git fetch origin main + git checkout main - name: Install Tools run: |