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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
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 clone --depth 1 "$CLONE_URL" .
|
||||||
git fetch origin ${{ gitea.ref }}:current-branch
|
cd ${GITHUB_WORKSPACE}
|
||||||
git checkout current-branch
|
git fetch origin main
|
||||||
|
git checkout main
|
||||||
|
|
||||||
- name: Install ArgoCD CLI
|
- name: Install ArgoCD CLI
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
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 clone --depth 1 "$CLONE_URL" .
|
||||||
git fetch origin ${{ gitea.ref }}:current-branch
|
cd ${GITHUB_WORKSPACE}
|
||||||
git checkout current-branch
|
git fetch origin main
|
||||||
|
git checkout main
|
||||||
|
|
||||||
- name: Install Tools
|
- name: Install Tools
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -19,10 +19,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
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 clone --depth 1 "$CLONE_URL" .
|
||||||
git fetch origin ${{ gitea.ref }}:current-branch
|
cd ${GITHUB_WORKSPACE}
|
||||||
git checkout current-branch
|
git fetch origin main
|
||||||
|
git checkout main
|
||||||
|
|
||||||
- name: Install Tools
|
- name: Install Tools
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user