From c0ba29283dcb318cb918615e34f2d90d05cc1019 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 16 Mar 2026 07:56:30 +0000 Subject: feat: add claudomator webhook notification to CI jobs Posts workflow_run events to the claudomator server on completion of both the build and smoke-test jobs (success or failure). Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/android.yml | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 701b6c4..aa292f2 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -42,6 +42,28 @@ jobs: groups: testers file: android-app/app/build/outputs/apk/debug/app-debug.apk + - name: Notify claudomator + if: always() + env: + CLAUDOMATOR_WEBHOOK_URL: ${{ secrets.CLAUDOMATOR_WEBHOOK_URL }} + CLAUDOMATOR_WEBHOOK_SECRET: ${{ secrets.CLAUDOMATOR_WEBHOOK_SECRET }} + run: | + PAYLOAD=$(jq -n \ + --arg action "completed" \ + --arg conclusion "${{ job.status }}" \ + --arg name "${{ github.workflow }}" \ + --arg repo "${{ github.repository }}" \ + --arg sha "${{ github.sha }}" \ + --arg run_id "${{ github.run_id }}" \ + '{action: $action, workflow_run: {conclusion: $conclusion, name: $name, head_sha: $sha, id: ($run_id | tonumber)}, repository: {full_name: $repo}}') + SIG=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$CLAUDOMATOR_WEBHOOK_SECRET" | awk '{print $2}') + curl -sf -X POST \ + -H "Content-Type: application/json" \ + -H "X-GitHub-Event: workflow_run" \ + -H "X-Hub-Signature-256: sha256=${SIG}" \ + "${CLAUDOMATOR_WEBHOOK_URL}/api/webhooks/github" \ + -d "$PAYLOAD" + smoke-test: runs-on: ubuntu-latest # Run after build succeeds so we don't spin up an emulator for a broken build @@ -74,3 +96,25 @@ jobs: profile: pixel_3a script: ./gradlew connectedDebugAndroidTest working-directory: android-app + + - name: Notify claudomator + if: always() + env: + CLAUDOMATOR_WEBHOOK_URL: ${{ secrets.CLAUDOMATOR_WEBHOOK_URL }} + CLAUDOMATOR_WEBHOOK_SECRET: ${{ secrets.CLAUDOMATOR_WEBHOOK_SECRET }} + run: | + PAYLOAD=$(jq -n \ + --arg action "completed" \ + --arg conclusion "${{ job.status }}" \ + --arg name "${{ github.workflow }} / smoke-test" \ + --arg repo "${{ github.repository }}" \ + --arg sha "${{ github.sha }}" \ + --arg run_id "${{ github.run_id }}" \ + '{action: $action, workflow_run: {conclusion: $conclusion, name: $name, head_sha: $sha, id: ($run_id | tonumber)}, repository: {full_name: $repo}}') + SIG=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$CLAUDOMATOR_WEBHOOK_SECRET" | awk '{print $2}') + curl -sf -X POST \ + -H "Content-Type: application/json" \ + -H "X-GitHub-Event: workflow_run" \ + -H "X-Hub-Signature-256: sha256=${SIG}" \ + "${CLAUDOMATOR_WEBHOOK_URL}/api/webhooks/github" \ + -d "$PAYLOAD" -- cgit v1.2.3