anusha94 has triggered Scan Action π #61
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: NCTL Scan Terraform Demo | |
run-name: ${{ github.actor }} has triggered Scan Action π | |
on: | |
pull_request: | |
branches: | |
- "main" | |
# push: | |
# branches: | |
# - "main" | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
AWS_SESSION_TOKEN: ${{secrets.AWS_SESSION_TOKEN}} | |
jobs: | |
NCTL-Scan-Terraform: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." | |
- name: Checkout PR branch | |
uses: actions/checkout@v3 | |
with: | |
# Checks out the repository linked to the PR | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
# Checks out the branch from the PR | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: nctl-scan-installer | |
uses: nirmata/[email protected] | |
- run: echo "π₯οΈ The workflow is now ready to test your code on the runner." | |
- name: Check nctl version | |
run: nctl version | |
- name: NCTL Scan - Terraform | |
# cd config-files/terraform/ecs | |
# terraform init | |
# terraform plan -out tfplan.binary | |
# terraform show -json tfplan.binary | jq > payload.json | |
run: | | |
./scripts/install-tf.sh | |
nctl scan terraform --policies controls/terraform-best-practices --resources config-files/terraform/ecs/payload.json | |
- run: echo "π This job's status is ${{ job.status }}." |