From bd9f0ab783aeeeb24eb4e1e2cf8917a9f642c8ff Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Thu, 23 Jul 2026 14:28:51 -0400 Subject: [PATCH 1/3] adding insteadOf --- action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.yml b/action.yml index 9a8999a..e18f2de 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,12 @@ outputs: runs: using: "composite" steps: + - name: Configure git HTTPS insteadOf SSH + shell: bash + run: | + git config --global url."https://github.e.it.census.gov/".insteadOf "ssh://git@github.e.it.census.gov/" + git config --global url."https://github.e.it.census.gov/".insteadOf "git@github.e.it.census.gov:" + - name: Terraform Init shell: bash run: | From cf14cc50d5ab9a29e7098fd846e3b7f96abbd19b Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Thu, 23 Jul 2026 16:26:12 -0400 Subject: [PATCH 2/3] fix: use --add to preserve both insteadOf rules --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e18f2de..99a395b 100644 --- a/action.yml +++ b/action.yml @@ -34,7 +34,7 @@ runs: shell: bash run: | git config --global url."https://github.e.it.census.gov/".insteadOf "ssh://git@github.e.it.census.gov/" - git config --global url."https://github.e.it.census.gov/".insteadOf "git@github.e.it.census.gov:" + git config --global --add url."https://github.e.it.census.gov/".insteadOf "git@github.e.it.census.gov:" - name: Terraform Init shell: bash From 9f79c56b36d4d6ab39669b259c5f3067be987ff6 Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Thu, 23 Jul 2026 16:42:27 -0400 Subject: [PATCH 3/3] feat: add gh-auth token-authenticated HTTPS insteadOf for terraform init SSH module pulls - Add github_app_pem_file, github_app_installation_id, github_app_id inputs - Add CSVD/gh-auth@main step to generate token (conditional on pem_file input) - Replace unauthenticated broken insteadOf with oauth2-token authenticated HTTPS rewrites - Mirrors pattern from CSVD/terraform-init action - Resolves CSVDIES-10490 --- action.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 99a395b..20ae5df 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,16 @@ inputs: var-file: description: 'Path to a Terraform tfvars file' required: false + github_app_pem_file: + description: 'GitHub App PEM file for SSH-to-HTTPS git rewrite during terraform init' + required: false + github_app_installation_id: + description: 'GitHub App Installation ID for SSH-to-HTTPS git rewrite during terraform init' + required: false + github_app_id: + description: 'GitHub App ID for SSH-to-HTTPS git rewrite during terraform init' + required: false + default: '6' outputs: is_valid: @@ -30,11 +40,21 @@ outputs: runs: using: "composite" steps: - - name: Configure git HTTPS insteadOf SSH + - name: Setup GITHUB Credentials + id: github_credentials + if: ${{ inputs.github_app_pem_file != '' }} + uses: CSVD/gh-auth@main + with: + github_app_pem_file: ${{ inputs.github_app_pem_file }} + github_app_installation_id: ${{ inputs.github_app_installation_id }} + github_app_id: ${{ inputs.github_app_id }} + + - name: Configure Git HTTPS for Terraform module pulls + if: ${{ inputs.github_app_pem_file != '' }} shell: bash run: | - git config --global url."https://github.e.it.census.gov/".insteadOf "ssh://git@github.e.it.census.gov/" - git config --global --add url."https://github.e.it.census.gov/".insteadOf "git@github.e.it.census.gov:" + git config --global url."https://oauth2:${{ steps.github_credentials.outputs.github_token }}@github.e.it.census.gov/".insteadOf "git@github.e.it.census.gov:" + git config --global url."https://oauth2:${{ steps.github_credentials.outputs.github_token }}@github.e.it.census.gov/".insteadOf "ssh://git@github.e.it.census.gov/" - name: Terraform Init shell: bash