Skip to content

Resolve linting warnings #178

Resolve linting warnings

Resolve linting warnings #178

Workflow file for this run

name: Terraform Plan Scanning Tests
on:
pull_request:
push:
paths:
- "action.yaml"
- "terraform-plan/*"
- "terraform-state/*"
- ".github/test_files/**"
branches:
- "main"
tags: ["v*.*.*"]
jobs:
terraform-tests:
runs-on: ubuntu-latest
name: Test Terraform scanning
steps:
- uses: actions/checkout@v4
# run terraform plan checks
- uses: hashicorp/setup-terraform@v2
with:
# super important setting, otherwise you cannot pipe terraform show -json
# see https://stackoverflow.com/questions/66496105/how-can-i-remove-all-the-extraneous-output-from-redirected-output-in-github-acti
terraform_wrapper: false
- run: terraform init
working-directory: ./.github/test_files/tfplan
- name: Write terraform plan
run: terraform plan -out plan
working-directory: ./.github/test_files/tfplan
- name: Export terraform plan to json
shell: bash
run: terraform show -json plan > plan.json
working-directory: ./.github/test_files/tfplan
- name: Upload terraform plan
uses: actions/upload-artifact@v3
with:
name: terraform-plan.json
path: .github/test_files/tfplan/plan.json
- name: Scan Terraform Plan
uses: ./terraform-plan
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SERVICE_ACCOUNT }}
with:
path: ".github/test_files/tfplan/"
plan-file: plan.json