diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33b7ee1f..13859608 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,3 +47,24 @@ jobs: run: bin/release-binary.sh "$MONGO_URL" "$MONGO_USERNAME" "$MONGO_PASSWORD" "$RELEASE_TAG" "stable" - name: Tweet about it run: ./gradlew -Penv=stable -Prelease=${{ github.event.inputs.version }} jreleaserAnnounce + + notify-failure: + name: "Notify on Failure" + runs-on: ubuntu-latest + needs: [build] + if: failure() + steps: + - name: Notify Chloé + env: + REPO: ${{ github.repository }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + MSG="❌ Release build failed: ${REPO}" + MSG+=$'\nRun: '"${RUN_URL}" + PAYLOAD=$(jq -n --arg msg "$MSG" --arg name "GitHub CI" \ + '{message: $msg, name: $name, deliver: true, channel: "discord", to: "user:918237603617206303"}') + curl -sf -X POST \ + -H "Authorization: Bearer ${{ secrets.OPENCLAW_HOOK_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "$PAYLOAD" \ + "${{ secrets.OPENCLAW_HOOK_URL }}"