feat(09-04): add Slack notification on pipeline failure
Some checks failed
Build and Push / test (push) Has been cancelled
Build and Push / build (push) Has been cancelled
Build and Push / notify (push) Has been cancelled

- Add notify job that runs when test or build fails
- Use curl to Slack webhook for Gitea compatibility
- Notify job depends on both test and build jobs
This commit is contained in:
Thomas Richter
2026-02-03 23:40:53 +01:00
parent 0daf7720dc
commit 81920c9125

View File

@@ -102,3 +102,16 @@ jobs:
git add helm/taskplaner/values.yaml
git commit -m "chore: update image tag to ${SHORT_SHA} [skip ci]" || echo "No changes to commit"
git push || echo "Push failed - may need to configure git credentials"
notify:
needs: [test, build]
runs-on: ubuntu-latest
if: failure()
steps:
- name: Notify Slack on failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"Pipeline failed for ${{ gitea.repository }} on ${{ gitea.ref }}\"}" \
$SLACK_WEBHOOK_URL