constellation/.github/workflows/test-tfsec.yml

41 lines
1010 B
YAML
Raw Normal View History

2022-09-20 11:38:37 +00:00
name: Terraform security scanner
on:
workflow_dispatch:
push:
branches:
- main
- "release/**"
2022-09-20 11:38:37 +00:00
paths:
- "**.tf"
- ".github/workflows/test-tfsec.yml"
2022-09-20 11:38:37 +00:00
pull_request:
paths:
- "**.tf"
- ".github/workflows/test-tfsec.yml"
2022-09-20 11:38:37 +00:00
jobs:
tfsec:
name: tfsec
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
2022-09-20 11:38:37 +00:00
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2022-09-20 11:38:37 +00:00
with:
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
2022-09-20 11:38:37 +00:00
- name: tfsec
uses: aquasecurity/tfsec-pr-commenter-action@5b483d46fb4fd0cbe2259cf68354a3fb23aa70fe
2022-09-20 11:38:37 +00:00
with:
soft_fail_commenter: true
2022-09-20 11:38:37 +00:00
tfsec_formats: default,text
tfsec_args: --force-all-dirs
github_token: ${{ github.token }}
- name: tfsec summary
shell: bash
run: tail -n 27 results.text >> "$GITHUB_STEP_SUMMARY"