Skip to content

Commit

Permalink
more gh actions fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachrundle committed Aug 11, 2024
1 parent 2eb272c commit 6ff24bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@ jobs:

- name: Run tfsec
id: tfsec
uses: aquasecurity/[email protected]
with:
soft_fail: true
run: |
tfsec > tfsec_output.txt
- name: Post tfsec results as PR comment
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v6
with:
script: |
let output = '';
await github.exec('tfsec', [], {
listeners: {
stdout: (data) => {
output += data.toString();
},
},
});
const fs = require('fs');
const output = fs.readFileSync('tfsec_output.txt', 'utf8');
const comment = `
## tfsec Scan Results
\`\`\`
Expand All @@ -45,4 +38,4 @@ jobs:
owner: github.context.repo.owner,
repo: github.context.repo.repo,
body: comment,
});
});
2 changes: 1 addition & 1 deletion provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ provider "aws" {
allowed_account_ids = [var.aws_account]

assume_role {
role_arn = "arn:aws:iam::${var.aws_account}:role/svc_terraform"
role_arn = "arn:aws:iam::${var.aws_account}:role/terraform-service"
session_name = "Terraform"
}

Expand Down

0 comments on commit 6ff24bf

Please sign in to comment.