From bb39dfa29ed09346eec2b283c03956508e19110d Mon Sep 17 00:00:00 2001 From: darnodo Date: Mon, 8 Dec 2025 11:56:05 +0100 Subject: [PATCH] ci: add GIT_TOKEN authentication to checkout steps The workflow was failing to checkout the repository in certain contexts or was requiring authentication that wasn't previously provided. This change: - Adds the `GIT_TOKEN` secret to the environment variables. - Updates the `git clone` commands in the `terraform-plan`, `terraform-apply`, and `terraform-destroy` jobs to include the `${GIT_TOKEN}@` prefix in the clone URL. This ensures that the workflow can successfully clone the repository even if it's private or requires authenticated access. --- .gitea/workflows/terraform.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/terraform.yml b/.gitea/workflows/terraform.yml index 1fce70a..98793ee 100644 --- a/.gitea/workflows/terraform.yml +++ b/.gitea/workflows/terraform.yml @@ -23,6 +23,7 @@ env: TF_VAR_proxmox_url: ${{ secrets.PROXMOX_URL }} TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }} TF_VAR_tailscale_auth_key: ${{ secrets.TAILSCALE_AUTH_KEY }} + GIT_TOKEN: ${{ secrets.GIT_TOKEN }} jobs: # =========================================================================== @@ -36,7 +37,7 @@ jobs: steps: - name: Checkout run: | - git clone --depth 1 --branch ${{ gitea.ref_name }} https://gitea.arnodo.fr/${{ gitea.repository }}.git . + git clone --depth 1 --branch ${{ gitea.ref_name }} https://${GIT_TOKEN}@gitea.arnodo.fr/${{ gitea.repository }}.git . git checkout ${{ gitea.sha }} - name: Terraform Format Check @@ -91,7 +92,7 @@ jobs: steps: - name: Checkout run: | - git clone --depth 1 --branch ${{ gitea.ref_name }} https://gitea.arnodo.fr/${{ gitea.repository }}.git . + git clone --depth 1 --branch ${{ gitea.ref_name }} https://${GIT_TOKEN}@gitea.arnodo.fr/${{ gitea.repository }}.git . git checkout ${{ gitea.sha }} - name: Terraform Init @@ -182,7 +183,7 @@ jobs: steps: - name: Checkout run: | - git clone --depth 1 --branch ${{ gitea.ref_name }} https://gitea.arnodo.fr/${{ gitea.repository }}.git . + git clone --depth 1 --branch ${{ gitea.ref_name }} https://${GIT_TOKEN}@gitea.arnodo.fr/${{ gitea.repository }}.git . git checkout ${{ gitea.sha }} - name: Terraform Init