Skip to content

chore(deps): update terraform sops to 1.1.1 #3

chore(deps): update terraform sops to 1.1.1

chore(deps): update terraform sops to 1.1.1 #3

Workflow file for this run

---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Terraform: Plan And Apply"
on:
workflow_dispatch: {}
pull_request:
branches:
- main
paths:
- '.github/workflows/terraform.yml'
- 'terraform/**'
env:
tf_actions_working_dir: terraform/gcp
terraform_version: 1.4.2
jobs:
plan:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.tf_actions_working_dir }}
steps:
- name: checkout
id: checkout_code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: 'google-github-actions/auth@55bd3a7c6e2ae7cf1877fd1ccb9d54c0503c457c' # v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@f0990588f1e5b5af6827153b93673613abdc6ec7 # v2.1.1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true
- uses: hashicorp/setup-terraform@97f030cf6dc0b4f5e0da352c7bca9cca34579800 # v3
with:
terraform_version: ${{ env.terraform_version }}
- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: false
- name: Terraform Lint
uses: reviewdog/action-tflint@master
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
fail_on_error: 'true'
filter_mode: 'nofilter'
- name: Terraform Init
id: init
run: terraform init
continue-on-error: false
- name: Terraform Validate
id: validate
run: terraform validate -no-color
continue-on-error: false
- name: Terraform Plan
id: plan
run: terraform plan -no-color
continue-on-error: false
- uses: actions/github-script@deb7ae927cc19ae3a8b57293dd5cd2f16171e1e2 # v4.1
if: github.event_name == 'pull_request'
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform Format and Style 🖌 \`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️ \`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖 ${{ steps.validate.outputs.stdout }}
#### Terraform Plan 📖 \`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`${process.env.PLAN}\`\`\`
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
}
apply:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs: ["plan"]
defaults:
run:
working-directory: ${{ env.tf_actions_working_dir }}
steps:
- name: checkout
id: checkout_code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: 'google-github-actions/auth@55bd3a7c6e2ae7cf1877fd1ccb9d54c0503c457c' # v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@f0990588f1e5b5af6827153b93673613abdc6ec7 # v2.1.1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true
- uses: hashicorp/setup-terraform@97f030cf6dc0b4f5e0da352c7bca9cca34579800 # v3
with:
terraform_version: ${{ env.terraform_version }}
- name: Terraform Init
id: init
run: terraform init
continue-on-error: false
- name: Terraform Apply
id: apply
run: terraform apply -no-color -auto-approve -input=false
continue-on-error: false