-
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.
- Loading branch information
1 parent
6ff24bf
commit 6b25a14
Showing
1 changed file
with
4 additions
and
27 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 |
---|---|---|
@@ -1,41 +1,18 @@ | ||
name: tfsec | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
tfsec: | ||
name: tfsec | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run tfsec | ||
id: tfsec | ||
run: | | ||
tfsec > tfsec_output.txt | ||
- name: Post tfsec results as PR comment | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: actions/github-script@v6 | ||
uses: actions/checkout@master | ||
- name: tfsec | ||
uses: aquasecurity/[email protected] | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const output = fs.readFileSync('tfsec_output.txt', 'utf8'); | ||
const comment = ` | ||
## tfsec Scan Results | ||
\`\`\` | ||
${output} | ||
\`\`\` | ||
`; | ||
github.rest.issues.createComment({ | ||
issue_number: github.context.issue.number, | ||
owner: github.context.repo.owner, | ||
repo: github.context.repo.repo, | ||
body: comment, | ||
}); | ||
soft_fail: true |