Skip to content

Update terraform-aws-modules/iam/aws requirement from ~> 5.34.0 to ~> 5.39.0 in /gooddata-cn-on-eks #7

Update terraform-aws-modules/iam/aws requirement from ~> 5.34.0 to ~> 5.39.0 in /gooddata-cn-on-eks

Update terraform-aws-modules/iam/aws requirement from ~> 5.34.0 to ~> 5.39.0 in /gooddata-cn-on-eks #7

Workflow file for this run

name: 'Terraform'
on:
push:
branches: [ "master" ]
# paths:
# - ./gooddata-cn-on-eks/**
pull_request:
branches: [ "master" ]
# paths:
# - ./gooddata-cn-on-eks/**
permissions:
contents: read
pull-requests: write
jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
working-directory: ./gooddata-cn-on-eks
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v4
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
# Checks that all Terraform configuration files adhere to a canonical format
- name: Terraform Format
id: fmt
run: terraform fmt -check
continue-on-error: true
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
id: init
run: terraform init
# Validate the configuration by checking syntax
- name: Terraform Validate
id: validate
run: terraform validate -no-color
# Generates an execution plan for Terraform
# - name: Terraform Plan
# run: terraform plan -input=false
# On push to "master", build or change infrastructure according to Terraform configuration files
# Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks
# - name: Terraform Apply
# if: github.ref == 'refs/heads/"master"' && github.event_name == 'push'
# run: terraform apply -auto-approve -input=false
# On pull request, report on the status of the terraform validation
- uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
script: |
// 1. Retrieve existing bot comments for the PR
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const botComment = comments.find(comment => {
return comment.user.type === 'Bot' && comment.body.includes('Terraform Format and Style')
})
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
<details><summary>Validation Output</summary>
\`\`\`\n
${{ steps.validate.outputs.stdout }}
\`\`\`
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Workflow: \`${{ github.workflow }}\`*`;
// 3. If we have a comment, update it, otherwise create a new one
if (botComment) {
github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: output
})
} else {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
}