From 4f60b80079d4b6873d8786632c11aa3bb6be8520 Mon Sep 17 00:00:00 2001 From: Jordan Ritter Date: Mon, 6 Apr 2026 13:37:57 -0700 Subject: [PATCH] ci: add Slack notifications for drift tests, competitive matrix, and new PRs --- .github/workflows/notify-pr.yml | 17 +++++++++++++++++ .github/workflows/test-drift.yml | 19 +++++++++++++++++++ .../workflows/update-competitive-matrix.yml | 17 +++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/workflows/notify-pr.yml diff --git a/.github/workflows/notify-pr.yml b/.github/workflows/notify-pr.yml new file mode 100644 index 0000000..c083ee4 --- /dev/null +++ b/.github/workflows/notify-pr.yml @@ -0,0 +1,17 @@ +name: PR Notification +on: + pull_request: + types: [opened] +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Notify Slack + run: | + PR_TITLE="${{ github.event.pull_request.title }}" + PR_URL="${{ github.event.pull_request.html_url }}" + PR_AUTHOR="${{ github.event.pull_request.user.login }}" + PR_NUM="${{ github.event.pull_request.number }}" + curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ + -H "Content-Type: application/json" \ + -d "{\"text\": \"🔀 New PR #${PR_NUM} on aimock by *${PR_AUTHOR}*: <${PR_URL}|${PR_TITLE}>\"}" diff --git a/.github/workflows/test-drift.yml b/.github/workflows/test-drift.yml index b76d6d1..e636ae7 100644 --- a/.github/workflows/test-drift.yml +++ b/.github/workflows/test-drift.yml @@ -44,6 +44,25 @@ jobs: if-no-files-found: warn retention-days: 30 + - name: Notify Slack + if: always() + run: | + if [ "${{ steps.drift.outputs.exit_code }}" = "2" ]; then + EMOJI="🚨" + MSG="*Drift detected* in aimock — providers changed response formats. " + elif [ "${{ job.status }}" = "success" ]; then + EMOJI="✅" + MSG="Drift tests passed — all providers match." + else + EMOJI="❌" + MSG="*Drift tests failed* (infra error). " + fi + curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ + -H "Content-Type: application/json" \ + -d "{\"text\": \"${EMOJI} ${MSG}\"}" + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + - name: Fail if critical drift detected if: steps.drift.outputs.exit_code == '2' run: exit 1 diff --git a/.github/workflows/update-competitive-matrix.yml b/.github/workflows/update-competitive-matrix.yml index a46338e..95e1b72 100644 --- a/.github/workflows/update-competitive-matrix.yml +++ b/.github/workflows/update-competitive-matrix.yml @@ -54,3 +54,20 @@ jobs: --base main env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Notify Slack + if: always() + run: | + if [ "${{ steps.changes.outputs.changed }}" = "true" ]; then + EMOJI="📊" + MSG="*Competitive matrix changes detected* — PR created with updated migration pages. " + elif [ "${{ job.status }}" = "success" ]; then + EMOJI="✅" + MSG="Competitive matrix check — no changes detected." + else + EMOJI="❌" + MSG="*Competitive matrix update failed*. " + fi + curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ + -H "Content-Type: application/json" \ + -d "{\"text\": \"${EMOJI} ${MSG}\"}"