feat(09-04): add Slack notification on pipeline failure
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user