Skip to content

Video upload workflow #790

Video upload workflow

Video upload workflow #790

Workflow file for this run

on:
pull_request:
paths:
- "infrastructure/applications/**/*"
- "infrastructure/applications/*"
- "infrastructure/azure-applications/*"
- "infrastructure/azure-applications/**/*"
name: Terraform Lint
env:
TF_WORKSPACE: "production"
jobs:
tfsec:
name: TFSec
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Clone repo
uses: actions/checkout@master
- name: tfsec
uses: aquasecurity/tfsec-pr-commenter-action@v1.2.0
with:
github_token: ${{ github.token }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Terraform Format
id: fmt
run: terraform fmt -check
env:
TF_IN_AUTOMATION: 1
plan:
name: Plan [AWS]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./infrastructure/applications
steps:
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.2.4
- name: Terraform Init
run: terraform init
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_IN_AUTOMATION: 1
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Plan
id: plan
run: terraform plan -no-color &> /dev/null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-central-1
TF_IN_AUTOMATION: 1
- name: Find Plan comment
uses: peter-evans/find-comment@v1
id: find_comment
with:
token: ${{ secrets.BOT_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
comment-author: pythonitaliabot
body-includes: "# Terraform"
- name: Create or Update comment
uses: peter-evans/create-or-update-comment@v1
if: steps.find_comment.outputs.comment-id != ''
with:
token: ${{ secrets.BOT_TOKEN }}
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
# Terraform
## Terraform Validation 🤖
${{ steps.validate.outputs.stdout }}
## Terraform Plan 📖
${{ steps.plan.outcome }}