Skip to content

Commit cf3c623

Browse files
Add approval notification jobwq
1 parent 77765ad commit cf3c623

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,32 @@ jobs:
130130
name: ${{ inputs.environment }}-data-replication-task-definition
131131
path: ${{ runner.temp }}/data-replication-task-definition.json
132132

133+
notify-approval-required:
134+
name: Notify on approval required
135+
runs-on: ubuntu-latest
136+
needs: prepare-deployment
137+
if: ${{ inputs.environment == 'production' }}
138+
steps:
139+
- name: Notify pending approval
140+
if: inputs.environment == 'production'
141+
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a
142+
with:
143+
webhook: ${{ secrets.SLACK_MAVIS_TECH_WEBHOOK_URL }}
144+
webhook-type: incoming-webhook
145+
payload: |
146+
text: ":hourglass: Approval required :hourglass:"
147+
blocks:
148+
- type: "section"
149+
text:
150+
type: "mrkdwn"
151+
text: "${{ github.workflow }} requires approval"
152+
- type: "section"
153+
fields:
154+
- type: "mrkdwn"
155+
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>"
156+
- type: "mrkdwn"
157+
text: "*Triggered by:*\n${{ github.actor }}"
158+
133159
approve-deployments:
134160
name: Wait for approval if required
135161
runs-on: ubuntu-latest

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,32 @@ jobs:
155155
name: tfplan_infrastructure-${{ inputs.environment }}
156156
path: ${{ runner.temp }}/tfplan
157157

158+
notify-approval-required:
159+
name: Notify on approval required
160+
runs-on: ubuntu-latest
161+
needs: plan
162+
if: ${{ inputs.environment == 'production' }}
163+
steps:
164+
- name: Notify pending approval
165+
if: inputs.environment == 'production'
166+
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a
167+
with:
168+
webhook: ${{ secrets.SLACK_MAVIS_TECH_WEBHOOK_URL }}
169+
webhook-type: incoming-webhook
170+
payload: |
171+
text: ":hourglass: Approval required :hourglass:"
172+
blocks:
173+
- type: "section"
174+
text:
175+
type: "mrkdwn"
176+
text: "${{ github.workflow }} requires approval"
177+
- type: "section"
178+
fields:
179+
- type: "mrkdwn"
180+
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>"
181+
- type: "mrkdwn"
182+
text: "*Triggered by:*\n${{ github.actor }}"
183+
158184
apply:
159185
name: Terraform apply
160186
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)