Skip to content

Commit e50ed64

Browse files
committed
Fix to terraform failure.
1 parent acd9e69 commit e50ed64

1 file changed

Lines changed: 6 additions & 25 deletions

File tree

.github/workflows/terraform.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@ name: Terraform
99
# The AUTOMATIC develop pipeline (apply TEST infra, then deploy the test site)
1010
# lives in the "Deploy Static Site (test.idptools.com)" workflow, which runs
1111
# terraform + deploy as ordered jobs after the Selenium Tests suite passes.
12-
# Terraform is NOT auto-run here on develop because chaining terraform -> deploy
13-
# across separate workflow_run workflows is unreliable: a workflow_run-triggered
14-
# run is attributed to the default branch, so the develop branch/SHA is lost on
15-
# the second hop.
12+
# Terraform is NOT auto-run here on develop: doing so would apply the TEST state
13+
# concurrently with that workflow's terraform job, and the two would race for
14+
# the S3 state lock (one wins, the other fails with 412 PreconditionFailed).
1615
#
1716
# CI authenticates with static-key secrets; local runs use your AWS SSO session.
1817

1918
on:
20-
# Run after the Selenium Tests suite passes for a develop push.
21-
workflow_run:
22-
workflows: ["Selenium Tests"]
23-
types: [completed]
24-
branches: [develop]
2519
workflow_dispatch:
2620
inputs:
2721
environment:
@@ -41,31 +35,18 @@ permissions:
4135
# Serialize runs per environment so two applies never overlap (in addition to
4236
# the S3-native state lock). Do not cancel an in-flight apply.
4337
concurrency:
44-
group: terraform-${{ github.event_name == 'workflow_dispatch' && github.event.inputs.environment || 'test' }}
38+
group: terraform-${{ github.event.inputs.environment }}
4539
cancel-in-progress: false
4640

4741
jobs:
4842
terraform:
4943
runs-on: ubuntu-latest
50-
# For a workflow_run trigger, only proceed if the test suite succeeded on
51-
# develop. Manual dispatch always proceeds.
52-
if: >-
53-
${{ github.event_name == 'workflow_dispatch' ||
54-
(github.event.workflow_run.conclusion == 'success' &&
55-
github.event.workflow_run.head_branch == 'develop') }}
56-
# Resolve environment/action from the trigger: the develop chain applies
57-
# test; a manual dispatch uses the chosen inputs.
5844
env:
59-
TF_ENV: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.environment || 'test' }}
60-
TF_ACTION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.action || 'apply' }}
45+
TF_ENV: ${{ github.event.inputs.environment }}
46+
TF_ACTION: ${{ github.event.inputs.action }}
6147
steps:
6248
- name: Checkout Repository
6349
uses: actions/checkout@v5
64-
with:
65-
# A workflow_run-triggered job checks out the default branch by
66-
# default; check out the exact commit the suite ran against. Manual
67-
# dispatch uses its own ref.
68-
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref }}
6950

7051
- name: Build terraform image
7152
run: docker build -t idptools-terraform -f infra/Dockerfile .

0 commit comments

Comments
 (0)