diff --git a/.github/workflows/infracost.yml b/.github/workflows/infracost.yml index 66c325f..f20a265 100644 --- a/.github/workflows/infracost.yml +++ b/.github/workflows/infracost.yml @@ -1,22 +1,19 @@ -name: 'Run Infracost' +name: 'Check Cost' on: pull_request: types: [opened, synchronize, closed] - push: - branches: - - main + jobs: infracost-pull-request-checks: name: Infracost Pull Request Checks if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') runs-on: ubuntu-latest environment: production - permissions: contents: read pull-requests: write # Required to post comments - + steps: - name: Setup Infracost uses: infracost/actions/setup@v3 @@ -47,6 +44,7 @@ jobs: --format=json \ --compare-to=/tmp/infracost-base.json \ --out-file=/tmp/infracost.json + - name: Post Infracost comment run: | infracost comment github --path=/tmp/infracost.json \