Skip to content

create a web asg and an ec2 boe instance instead #20755

create a web asg and an ec2 boe instance instead

create a web asg and an ec2 boe instance instead #20755

name: Terraform Static Code Analysis
# Runs changed scan on pull request, full scan on workflow_dispatch and scheduled.
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 7 * * 1-5'
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'terraform/**'
- '.github/workflows/terraform-static-analysis.yml'
permissions:
contents: read
jobs:
terraform-static-analysis:
permissions:
pull-requests: write
name: Terraform Static Analysis
runs-on: ubuntu-latest
if: github.event_name != 'workflow_dispatch' && github.event_name != 'schedule'
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 1
- name: Run Analysis
uses: ministryofjustice/github-actions/terraform-static-analysis@1b6396ceb7bf09e741789c4e7eb7b329d5113066 # v15.4.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scan_type: changed
tfsec_exclude: AWS095
tflint_exclude: terraform_unused_declarations
tflint_call_module_type: none
terraform-static-analysis-full-scan:
permissions:
pull-requests: write
name: Terraform Static Analysis - scan all directories
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Run Analysis
uses: ministryofjustice/github-actions/terraform-static-analysis@1b6396ceb7bf09e741789c4e7eb7b329d5113066 # v15.4.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scan_type: full
tfsec_exclude: AWS095
tflint_exclude: terraform_unused_declarations
tflint_call_module_type: none
terraform-static-analysis-scheduled-scan:
name: Terraform Static Analysis - scheduled scan of all directories
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Run Analysis
uses: ministryofjustice/github-actions/terraform-static-analysis@1b6396ceb7bf09e741789c4e7eb7b329d5113066 # v15.4.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scan_type: full
tfsec_exclude: AWS095
tflint_exclude: terraform_unused_declarations
tflint_call_module_type: none