Skip to content

Commit b2f133d

Browse files
Integrate policy enforcement with Overmind custom signals
- Restructure workflow to run policy checks after plan submission - Add outputs to capture Terraform Cloud run URL from submit-plan - Create separate policy-checks job that depends on execute job - Pass custom ticket-link to policy-signals-action for proper Terraform Cloud integration - Policy violations now appear in Overmind UI linked to correct Terraform runs
1 parent c42418b commit b2f133d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/automatic.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
id: fmt
1717
run: terraform fmt -check -diff
1818

19-
# NEW: Policy checks job running in parallel
2019
policy-checks:
2120
runs-on: ubuntu-latest
2221
if: github.event.action != 'closed'
22+
needs: execute
2323
permissions:
2424
contents: read
2525
id-token: write
@@ -32,20 +32,26 @@ jobs:
3232
with:
3333
terraform_deploy_role: ${{ vars.TERRAFORM_DEPLOY_ROLE }}
3434

35-
- name: Generate Plan for Policies
36-
id: policy-plan
35+
- name: Download terraform plan
36+
uses: actions/download-artifact@v4
37+
with:
38+
name: tfplan
39+
40+
- name: Convert plan to JSON
3741
run: |
38-
terraform plan -no-color -input=false -out tfplan.policies
39-
terraform show -json tfplan.policies > tfplan.json
42+
terraform show -json tfplan > tfplan.json
4043
4144
- uses: overmindtech/policy-signals-action@v1
4245
with:
4346
policies-path: './policies'
44-
overmind-api-key: ${{ secrets.OVM_API_KEY }}
4547
terraform-plan-json: './tfplan.json'
48+
overmind-api-key: ${{ secrets.OVM_API_KEY }}
49+
ticket-link: ${{ needs.execute.outputs.run-url }}
4650

4751
execute:
4852
runs-on: ubuntu-latest
53+
outputs:
54+
run-url: ${{ steps.submit-plan.outputs.run-url }}
4955
permissions:
5056
contents: read # required for checkout
5157
id-token: write # mint AWS credentials through OIDC

0 commit comments

Comments
 (0)