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.
This commit is contained in:
@@ -23,6 +23,7 @@ env:
|
|||||||
TF_VAR_proxmox_url: ${{ secrets.PROXMOX_URL }}
|
TF_VAR_proxmox_url: ${{ secrets.PROXMOX_URL }}
|
||||||
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
||||||
TF_VAR_tailscale_auth_key: ${{ secrets.TAILSCALE_AUTH_KEY }}
|
TF_VAR_tailscale_auth_key: ${{ secrets.TAILSCALE_AUTH_KEY }}
|
||||||
|
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
@@ -36,7 +37,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
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 }}
|
git checkout ${{ gitea.sha }}
|
||||||
|
|
||||||
- name: Terraform Format Check
|
- name: Terraform Format Check
|
||||||
@@ -91,7 +92,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
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 }}
|
git checkout ${{ gitea.sha }}
|
||||||
|
|
||||||
- name: Terraform Init
|
- name: Terraform Init
|
||||||
@@ -182,7 +183,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
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 }}
|
git checkout ${{ gitea.sha }}
|
||||||
|
|
||||||
- name: Terraform Init
|
- name: Terraform Init
|
||||||
|
|||||||
Reference in New Issue
Block a user