Skip to content

Commit

Permalink
Update terraform_on_pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
irab authored Feb 15, 2024
1 parent 5f6c551 commit 43f09a4
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions .github/workflows/terraform_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,5 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: 'Get Terrahelp Binary'
run: wget -c https://github.com/opencredo/terrahelp/releases/download/v0.7.5/terrahelp_0.7.5_linux_amd64.tar.gz -O - | tar -xz

- name: 'Check Integrity' # Double space needed between SHA and filename
run: echo "${{ env.terrahelp_shasum }} ./terrahelp" | shasum -a256 -c-

- name: 'Decrypt State'
run: ./terrahelp decrypt --mode=full --simple-key=${{ secrets.TERRAHELP_KEY }} --nobackup --file terraform.tfstate -file=terraform.tfstate.backup

- id: init
run: terraform init

- id: validate
run: terraform validate -no-color

- id: plan
run: terraform plan -no-color --input=false
continue-on-error: false
env:
TF_VAR_cloudflare_zone_id: ${{ secrets.CF_ZONE_ID }}
TF_VAR_cloudflare_api_token: ${{ secrets.CF_API_TOKEN }}

- id: apply
run: terraform apply -no-color --input=false -auto-approve
continue-on-error: false
env:
TF_VAR_cloudflare_zone_id: ${{ secrets.CF_ZONE_ID }}
TF_VAR_cloudflare_api_token: ${{ secrets.CF_API_TOKEN }}

- name: 'Encrypt State'
run: ./terrahelp encrypt --mode=full --simple-key=${{ secrets.TERRAHELP_KEY }} --nobackup --file terraform.tfstate -file=terraform.tfstate.backup

- name: 'Commit New State'
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add terraform.tfstate terraform.tfstate.backup
git commit -m "Add updated state"
git push origin
- name: test
run: cat .git/branches/config

0 comments on commit 43f09a4

Please sign in to comment.