Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: rewrite SSH module URLs to HTTPS in terraform-validate workflow
In the GitHub Actions CI environment, the runner has no SSH key configured
for github.e.it.census.gov, so 'terraform init' fails when pulling modules
whose source URLs use the SSH git@ scheme (e.g. tags.tf, examples/simple/eks.tf).
Changes made to .github/workflows/terraform-validate.yaml:
1. Added 'Setup GITHUB Credentials' step (CSVD/gh-auth@main)
- Obtains a short-lived GitHub App token using the repository's
GH_APP_PEM_FILE secret and GH_APP_ID / GH_APP_INSTALLATION_ID vars.
- This mirrors the credential setup already present in the release workflow.
2. Added 'Configure Git HTTPS for Terraform module pulls' step
- Runs: git config --global url."https://oauth2:<token>@github.e.it.census.gov/".insteadOf "git@github.e.it.census.gov:"
- This tells git to transparently rewrite any SSH git@ URL for this host
to an authenticated HTTPS URL at the transport layer.
- Terraform shells out to the system git binary for module fetches, so
it honours this rewrite without any changes to .tf source URLs.
No .tf files are modified: SSH source URLs in tags.tf and examples/simple/eks.tf
remain intact so that developers using SSH keys locally are unaffected.- Loading branch information