diff --git a/.gitea/workflows/deploy-infrastructure.yml b/.gitea/workflows/deploy-infrastructure.yml index b51b7dd..db7df59 100644 --- a/.gitea/workflows/deploy-infrastructure.yml +++ b/.gitea/workflows/deploy-infrastructure.yml @@ -38,7 +38,15 @@ jobs: - name: Setup OpenTofu uses: opentofu/setup-opentofu@v1 - + + - name: Configure Git Auth for Private Modules + run: | + # Strip the protocol (https:// or http://) from the server URL + GITEA_HOST=$(echo "${{ gitea.server_url }}" | sed -e 's|^[^/]*//||') + + # Tell Git to use the actor and token for any request matching your server + git config --global url."https://${{ gitea.actor }}:${{ secrets.GITEA_TOKEN }}@$GITEA_HOST/".insteadOf "${{ gitea.server_url }}/" + - name: OpenTofu Init & Apply run: | tofu init