fix: Moved scripts and deps into scripts dir #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Template Scanner | ||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
jobs: | ||
tf-scan: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ secrets.git_role }} | ||
aws-region: "us-east-1" | ||
role-duration-seconds: 3600 | ||
role-session-name: GithubActions-Session | ||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_wrapper: false | ||
- name: Terraform Init | ||
working-directory: ./infra | ||
run: | | ||
terraform init | ||
- name: Terraform Plan | ||
working-directory: ./infra | ||
run: | | ||
terraform plan -out=plan.out | ||
- name: Terraform convert to json | ||
working-directory: ./infra | ||
run: | | ||
terraform show -json plan.out > tf_plan.json | ||
- name: Initiate scan | ||
working-directory: ./scripts | ||
run: | | ||
python3 -m pip install -r requirements.txt | ||
python3 tf_scan.py \ | ||
--region "us-1" --api_key ${{secrets.conformity_api_key}} \ | ||
--template_type "terraform-template" \ | ||
--template_path "infra/tf_plan.json" |