diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8241363..cc44d5e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,10 +10,12 @@ jobs: name: Build & Run Unit Tests runs-on: self-hosted steps: - # Remplacement de actions/checkout par un clone Git manuel sécurisé - name: Clone repository run: | - git clone --depth 1 https://oauth2:${{ secrets.GITHUB_TOKEN }}@${{ github.server_url }}/${{ github.repository }}.git . + SERVER_URL="${{ github.server_url }}" + SERVER_NO_PROTO="${SERVER_URL#http://}" + SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}" + git clone --depth 1 "https://oauth2:${{ secrets.GITHUB_TOKEN }}@${SERVER_NO_PROTO}/${{ github.repository }}.git" . git checkout ${{ github.sha }} - name: Run Maven Tests in Docker @@ -31,7 +33,10 @@ jobs: steps: - name: Clone repository run: | - git clone --depth 1 https://oauth2:${{ secrets.GITHUB_TOKEN }}@${{ github.server_url }}/${{ github.repository }}.git . + SERVER_URL="${{ github.server_url }}" + SERVER_NO_PROTO="${SERVER_URL#http://}" + SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}" + git clone --depth 1 "https://oauth2:${{ secrets.GITHUB_TOKEN }}@${SERVER_NO_PROTO}/${{ github.repository }}.git" . git checkout ${{ github.sha }} - name: Deploy with Docker Compose