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)
This commit is contained in:
@@ -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: |
|
||||
|
||||
@@ -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: |
|
||||
|
||||
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user