Skip to content

Commit 19f70ed

Browse files
chore(ci): add failure notification for release pipeline (camunda#354)
* chore(ci): add failure notification for release pipeline * fix(ci): use OIDC/JWT for Vault auth and slack-github-action for notifications Switch the notify-on-failure jobs from Vault AppRole to the JWT/OIDC auth method (VAULT_JWT_ROLE/PATH/AUDIENCE, already provisioned for this repo), and replace the ad-hoc curl-based Slack notification with the maintained slackapi/slack-github-action, matching the pattern used across the org. * test(ci): add temporary workflow to validate Vault JWT + Slack notify Sanity-checks the Vault JWT auth + slack-github-action wiring used in build-and-test-ee.yml / build-and-test-qa.yml before relying on it. To be removed once confirmed. * chore(ci): remove temporary Vault/Slack validation workflow Confirmed working, no longer needed. --------- Co-authored-by: Patrick Poetz <patrick.poetz@camunda.com>
1 parent fcc23ef commit 19f70ed

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

.github/workflows/build-and-test-ee.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,46 @@ jobs:
9898
SNAPSHOT: ${{ github.event.inputs.snapshot }}
9999
PUSH_REGISTRY: registry.camunda.cloud/cambpm-ee
100100

101+
# Runs whenever any of the jobs above failed, so failures don't pass by unnoticed.
102+
# `if: failure()` deliberately overrides the default "skip if a dependency didn't
103+
# succeed" behavior, so this still fires even if e.g. create-manifests-ee was
104+
# skipped (PR runs) while build-and-test-ee failed.
105+
notify-on-failure:
106+
if: failure()
107+
needs: [build-and-test-ee, create-manifests-ee]
108+
runs-on: ubuntu-22.04
109+
permissions:
110+
contents: read
111+
id-token: write # mint GitHub OIDC token for Vault JWT auth
112+
steps:
113+
- name: Import Secrets
114+
id: secrets
115+
uses: hashicorp/vault-action@v3.4.0
116+
with:
117+
url: ${{ secrets.VAULT_ADDR }}
118+
method: jwt
119+
path: ${{ secrets.VAULT_JWT_PATH }}
120+
role: ${{ secrets.VAULT_JWT_ROLE }}
121+
jwtGithubAudience: ${{ secrets.VAULT_JWT_AUDIENCE }}
122+
exportEnv: false
123+
secrets: |
124+
secret/data/products/cambpm/ci/slack NOTIFY_INTERNAL_WEBHOOK | NOTIFY_INTERNAL_WEBHOOK;
125+
126+
- name: Notify Slack
127+
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
128+
with:
129+
webhook: ${{ steps.secrets.outputs.NOTIFY_INTERNAL_WEBHOOK }}
130+
webhook-type: incoming-webhook
131+
payload: |
132+
{
133+
"blocks": [
134+
{
135+
"type": "section",
136+
"text": {
137+
"type": "mrkdwn",
138+
"text": ":x: *Build and Test EE* failed${{ github.event.inputs.version && format(' for version `{0}`', github.event.inputs.version) || '' }} on `${{ github.ref_name }}`. <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run>"
139+
}
140+
}
141+
]
142+
}
143+

.github/workflows/build-and-test-qa.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,46 @@ jobs:
249249
VERSION_TAG: ${{ needs.prepare.outputs.version_tag }}
250250
LATEST_TAG: ${{ needs.prepare.outputs.latest_tag }}
251251

252+
# Runs whenever any of the jobs above failed, so failures don't pass by unnoticed.
253+
# `if: failure()` deliberately overrides the default "skip if a dependency didn't
254+
# succeed" behavior, so this still fires even if e.g. `prepare` failed and the
255+
# remaining jobs were consequently skipped rather than failed themselves.
256+
notify-on-failure:
257+
if: failure()
258+
needs: [prepare, build-and-test-qa, create-manifests-qa]
259+
runs-on: ubuntu-22.04
260+
permissions:
261+
contents: read
262+
id-token: write # mint GitHub OIDC token for Vault JWT auth
263+
steps:
264+
- name: Import Secrets
265+
id: secrets
266+
uses: hashicorp/vault-action@v3.4.0
267+
with:
268+
url: ${{ secrets.VAULT_ADDR }}
269+
method: jwt
270+
path: ${{ secrets.VAULT_JWT_PATH }}
271+
role: ${{ secrets.VAULT_JWT_ROLE }}
272+
jwtGithubAudience: ${{ secrets.VAULT_JWT_AUDIENCE }}
273+
exportEnv: false
274+
secrets: |
275+
secret/data/products/cambpm/ci/slack NOTIFY_INTERNAL_WEBHOOK | NOTIFY_INTERNAL_WEBHOOK;
276+
277+
- name: Notify Slack
278+
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
279+
with:
280+
webhook: ${{ steps.secrets.outputs.NOTIFY_INTERNAL_WEBHOOK }}
281+
webhook-type: incoming-webhook
282+
payload: |
283+
{
284+
"blocks": [
285+
{
286+
"type": "section",
287+
"text": {
288+
"type": "mrkdwn",
289+
"text": ":x: *Build and Test QA* failed for version `${{ github.event.inputs.version }}` on `${{ github.ref_name }}`. <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run>"
290+
}
291+
}
292+
]
293+
}
294+

0 commit comments

Comments
 (0)