From e46ab7913a7726b98050d78a8833c3b55c90bde7 Mon Sep 17 00:00:00 2001 From: Carles Onielfa Date: Thu, 9 Jul 2026 15:52:39 +0200 Subject: [PATCH 1/3] Add workflow failure Teams notifications --- .../hyperforge_teams_test_alert.yaml | 28 +++++++++++++++++++ .github/workflows/hyperforge_workflow.yaml | 25 +++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/hyperforge_teams_test_alert.yaml diff --git a/.github/workflows/hyperforge_teams_test_alert.yaml b/.github/workflows/hyperforge_teams_test_alert.yaml new file mode 100644 index 0000000..e1d47c2 --- /dev/null +++ b/.github/workflows/hyperforge_teams_test_alert.yaml @@ -0,0 +1,28 @@ +name: Hyperforge Teams Test Alert + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + notify-teams-test: + name: Send test Teams notification + runs-on: ubuntu-24.04 + steps: + - name: Send Teams notification + run: | + curl -s -o /dev/null -w "%{http_code}" \ + -H "Content-Type: application/json" \ + -d '{ + "@type": "MessageCard", + "@context": "http://schema.org/extensions", + "themeColor": "FF0000", + "summary": "[TEST] Hyperforge CI failed", + "sections": [{ + "activityTitle": "**[TEST] Hyperforge CI failed on `${{ github.ref_name }}`**", + "activityText": "This is a test notification. Run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for commit `${{ github.sha }}`." + }] + }' \ + "${{ secrets.TEAMS_WEBHOOK_URL }}" diff --git a/.github/workflows/hyperforge_workflow.yaml b/.github/workflows/hyperforge_workflow.yaml index 91c50fc..30d74bd 100644 --- a/.github/workflows/hyperforge_workflow.yaml +++ b/.github/workflows/hyperforge_workflow.yaml @@ -131,3 +131,28 @@ jobs: run: | docker push "ghcr.io/$REPOSITORY_OWNER/hyperforge:$IMAGE_SHA_TAG" docker push "ghcr.io/$REPOSITORY_OWNER/hyperforge:$IMAGE_REF_TAG" + + notify-teams-fail: + name: Notify Teams on failure + needs: + - test + - build_wheels + - build_and_push_docker_image + if: (failure() || cancelled()) && github.event_name == 'push' + runs-on: ubuntu-24.04 + steps: + - name: Send Teams notification + run: | + curl -s -o /dev/null -w "%{http_code}" \ + -H "Content-Type: application/json" \ + -d '{ + "@type": "MessageCard", + "@context": "http://schema.org/extensions", + "themeColor": "FF0000", + "summary": "Hyperforge CI failed", + "sections": [{ + "activityTitle": "**Hyperforge CI failed on `${{ github.ref_name }}`**", + "activityText": "Run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed for commit `${{ github.sha }}`." + }] + }' \ + "${{ secrets.TEAMS_WEBHOOK_URL }}" From fe54976d0f3ee7d6922f949503491decf6061e25 Mon Sep 17 00:00:00 2001 From: Carles Onielfa Date: Thu, 9 Jul 2026 15:56:02 +0200 Subject: [PATCH 2/3] delete --- .../hyperforge_teams_test_alert.yaml | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/hyperforge_teams_test_alert.yaml diff --git a/.github/workflows/hyperforge_teams_test_alert.yaml b/.github/workflows/hyperforge_teams_test_alert.yaml deleted file mode 100644 index e1d47c2..0000000 --- a/.github/workflows/hyperforge_teams_test_alert.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Hyperforge Teams Test Alert - -on: - workflow_dispatch: - -permissions: - contents: read - -jobs: - notify-teams-test: - name: Send test Teams notification - runs-on: ubuntu-24.04 - steps: - - name: Send Teams notification - run: | - curl -s -o /dev/null -w "%{http_code}" \ - -H "Content-Type: application/json" \ - -d '{ - "@type": "MessageCard", - "@context": "http://schema.org/extensions", - "themeColor": "FF0000", - "summary": "[TEST] Hyperforge CI failed", - "sections": [{ - "activityTitle": "**[TEST] Hyperforge CI failed on `${{ github.ref_name }}`**", - "activityText": "This is a test notification. Run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for commit `${{ github.sha }}`." - }] - }' \ - "${{ secrets.TEAMS_WEBHOOK_URL }}" From 2fc22eb1a4bd5010d2b9c3b9f65d867ece98c91c Mon Sep 17 00:00:00 2001 From: Carles Onielfa Date: Thu, 9 Jul 2026 16:00:25 +0200 Subject: [PATCH 3/3] fix --- .github/workflows/hyperforge_workflow.yaml | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/hyperforge_workflow.yaml b/.github/workflows/hyperforge_workflow.yaml index 30d74bd..8e526b3 100644 --- a/.github/workflows/hyperforge_workflow.yaml +++ b/.github/workflows/hyperforge_workflow.yaml @@ -142,17 +142,23 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Send Teams notification + env: + REF_NAME: ${{ github.ref_name }} + RUN_NUMBER: ${{ github.run_number }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + COMMIT_SHA: ${{ github.sha }} + TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }} run: | curl -s -o /dev/null -w "%{http_code}" \ -H "Content-Type: application/json" \ - -d '{ - "@type": "MessageCard", - "@context": "http://schema.org/extensions", - "themeColor": "FF0000", - "summary": "Hyperforge CI failed", - "sections": [{ - "activityTitle": "**Hyperforge CI failed on `${{ github.ref_name }}`**", - "activityText": "Run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed for commit `${{ github.sha }}`." + -d "{ + \"@type\": \"MessageCard\", + \"@context\": \"http://schema.org/extensions\", + \"themeColor\": \"FF0000\", + \"summary\": \"Hyperforge CI failed\", + \"sections\": [{ + \"activityTitle\": \"**Hyperforge CI failed on \`${REF_NAME}\`**\", + \"activityText\": \"Run [#${RUN_NUMBER}](${RUN_URL}) failed for commit \`${COMMIT_SHA}\`.\" }] - }' \ - "${{ secrets.TEAMS_WEBHOOK_URL }}" + }" \ + "$TEAMS_WEBHOOK_URL"