forked from bcgov/supreme-court-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create an action for scan infra to make it reusable
- Loading branch information
Ronaldo Macapobre
committed
Aug 20, 2024
1 parent
47c45b7
commit 38f5382
Showing
2 changed files
with
28 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Scan Infra | ||
|
||
inputs: | ||
working_directory: | ||
description: "Folder location where the TF scripts lives" | ||
required: true | ||
environment: | ||
description: "Environment name" | ||
required: true | ||
|
||
jobs: | ||
tfsec: | ||
name: Scan Terraform Code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: tfsec | ||
uses: aquasecurity/[email protected] | ||
with: | ||
working_directory: ${{ inputs.working_directory }} | ||
additional_args: "--tfvars-file=${{ inputs.working_directory }}/${{ inputs.environment }}.tfvars" | ||
soft_fail: false | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,19 +54,10 @@ jobs: | |
scan: | ||
name: Scan TF Code | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: tfsec | ||
uses: aquasecurity/[email protected] | ||
with: | ||
working_directory: ${{ inputs.CONTEXT_FOLDER }} | ||
soft_fail: false | ||
uses: ./.github/workflows/actions/scan-infra | ||
with: | ||
working_directory: ${{ inputs.CONTEXT_FOLDER }} | ||
environment: ${{ inputs.ENVIRONMENT_NAME }} | ||
needs: [check_changes] | ||
|
||
deploy_infra: | ||
|