Skip to content

Commit 6783bef

Browse files
chloe41427[bot]marc0der
authored andcommitted
chore: notify Chloé on release build failure
1 parent f2e682d commit 6783bef

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,24 @@ jobs:
5252
version="${{ steps.tag_version.outputs.version }}"
5353
commit_hash=$(git rev-parse --short=8 HEAD)
5454
./gradlew build jib -Djib.to.tags=$commit_hash,$version,latest
55+
56+
notify-failure:
57+
name: "Notify on Failure"
58+
runs-on: ubuntu-latest
59+
needs: [build]
60+
if: failure()
61+
steps:
62+
- name: Notify Chloé
63+
env:
64+
REPO: ${{ github.repository }}
65+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
66+
run: |
67+
MSG="❌ Release build failed: ${REPO}"
68+
MSG+=$'\nRun: '"${RUN_URL}"
69+
PAYLOAD=$(jq -n --arg msg "$MSG" --arg name "GitHub CI" \
70+
'{message: $msg, name: $name, deliver: true, channel: "discord", to: "user:918237603617206303"}')
71+
curl -sf -X POST \
72+
-H "Authorization: Bearer ${{ secrets.OPENCLAW_HOOK_TOKEN }}" \
73+
-H "Content-Type: application/json" \
74+
-d "$PAYLOAD" \
75+
"${{ secrets.OPENCLAW_HOOK_URL }}"

0 commit comments

Comments
 (0)