Skip to content

Commit 2035ee7

Browse files
committed
Use event name to determine if approval is required
1 parent 401cd36 commit 2035ee7

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

.github/workflows/data-replication-pipeline.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,11 @@ on:
3131
description: Git ref to deploy, for example, a tag, branch name or commit SHA
3232
type: string
3333
required: true
34-
skip_approval:
35-
description: Skip environment approval (auto-approve)
36-
type: boolean
37-
default: false
3834

3935
permissions: {}
4036

4137
env:
4238
environment: ${{ inputs.environment }}
43-
deployment_type: ${{ inputs.deployment_type }}
44-
db_snapshot_arn: ${{ inputs.db_snapshot_arn }}
45-
egress_cidr: ${{ inputs.egress_cidr }}
46-
take_db_snapshot: ${{ inputs.take_db_snapshot }}
4739
git_ref_to_deploy: ${{ inputs.git_ref_to_deploy || github.sha }}
4840
aws_role: ${{ inputs.environment == 'production'
4941
&& 'arn:aws:iam::820242920762:role/GithubDeployDataReplicationInfrastructure'
@@ -148,7 +140,7 @@ jobs:
148140
name: Notify on approval required
149141
runs-on: ubuntu-latest
150142
needs: prepare-deployment
151-
if: ${{ inputs.environment == 'production' && inputs.skip_approval == 'false' }}
143+
if: ${{ inputs.environment == 'production' && github.event_name == 'workflow_dispatch' }}
152144
steps:
153145
- name: Notify pending approval
154146
if: inputs.environment == 'production'
@@ -174,7 +166,7 @@ jobs:
174166
name: Wait for approval if required
175167
runs-on: ubuntu-latest
176168
needs: prepare-deployment
177-
environment: ${{ inputs.skip_approval && null || inputs.environment }}
169+
environment: ${{ github.event_name == 'workflow_dispatch' && inputs.environment || null }}
178170
steps:
179171
- run: echo "Proceeding with deployment to $environment environment"
180172

.github/workflows/refresh-data-replication.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ on:
4747
description: Take a new DB snapshot before creating the environment
4848
type: boolean
4949
default: false
50-
skip_approval:
51-
description: Skip environment approval (auto-approve)
52-
type: boolean
53-
default: false
5450

5551
permissions: {}
5652

@@ -184,7 +180,7 @@ jobs:
184180
name: Notify on approval required
185181
runs-on: ubuntu-latest
186182
needs: plan
187-
if: ${{ inputs.environment == 'production' && inputs.skip_approval == 'false' }}
183+
if: ${{ inputs.environment == 'production' && github.event_name == 'workflow_dispatch' }}
188184
steps:
189185
- name: Notify pending approval
190186
if: inputs.environment == 'production'
@@ -210,7 +206,7 @@ jobs:
210206
name: Terraform apply
211207
runs-on: ubuntu-latest
212208
needs: plan
213-
environment: ${{ inputs.skip_approval && null || inputs.environment }}
209+
environment: ${{ github.event_name == 'workflow_dispatch' && inputs.environment || null }}
214210
permissions:
215211
id-token: write
216212
steps:

.github/workflows/scheduled-data-replication-refresh.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
"52.178.45.139/32" # GIAS
2424
]
2525
take_db_snapshot: false
26-
skip_approval: true
2726
deploy-image:
2827
name: Deploy image
2928
needs: refresh-data-replication
@@ -33,4 +32,3 @@ jobs:
3332
with:
3433
environment: production
3534
git_ref_to_deploy: main
36-
skip_approval: true

0 commit comments

Comments
 (0)