diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 07:56:30 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 07:56:30 +0000 |
| commit | c0ba29283dcb318cb918615e34f2d90d05cc1019 (patch) | |
| tree | 45f32fdab885d9bfc3bec5223b63b290a0825924 /.github/workflows/android.yml | |
| parent | 9f694c364e547cb767a8f76a0cabf25ee06d6cc7 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to '.github/workflows/android.yml')
| -rw-r--r-- | .github/workflows/android.yml | 44 |
1 files changed, 44 insertions, 0 deletions
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" |
