diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index 58e71a8..ed6ad76 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -17,23 +17,16 @@ jobs: - name: Run tfsec id: tfsec - uses: aquasecurity/tfsec-action@v1.0.0 - 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 \`\`\` @@ -45,4 +38,4 @@ jobs: owner: github.context.repo.owner, repo: github.context.repo.repo, body: comment, - }); \ No newline at end of file + }); diff --git a/provider.tf b/provider.tf index c8305b0..9403982 100644 --- a/provider.tf +++ b/provider.tf @@ -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" }