Skip to content

Commit 36e38ca

Browse files
committed
[#11] Passes GITHUB_TOKEN to terraform init step (and uses it securely)
1 parent 7d5b0d3 commit 36e38ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

action.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ runs:
7070
shell: bash
7171
working-directory: ${{ inputs.working-directory }}
7272
env:
73-
TF_VAR_github_token: ${{ inputs.GITHUB_TOKEN }}
74-
run: terraform init ${{ inputs.terraform-init-flags }}
73+
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
74+
run: |
75+
git config --global url."https://oauth2:${GITHUB_TOKEN}@github.com".insteadOf https://github.com
76+
terraform init ${{ inputs.terraform-init-flags }}
7577
7678
- name: Post Init
7779
if: ${{ github.event_name == 'pull_request' }}

0 commit comments

Comments
 (0)