ci: add GIT_TOKEN authentication to checkout steps
All checks were successful
Terraform CI/CD / Validate (push) Successful in 6s
Terraform CI/CD / Plan (push) Successful in 8s
Terraform CI/CD / Apply (push) Has been skipped

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.
This commit is contained in:
darnodo
2025-12-08 11:56:05 +01:00
parent a02582aaea
commit bb39dfa29e

View File

@@ -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