Skip to content

Commit

Permalink
build: smoke test webhook (#830)
Browse files Browse the repository at this point in the history
* build: wip

* fix: content now visible in post

* chore: updated button text

* ci: webbhook to post failure in teams channel
  • Loading branch information
mistermalm authored Nov 12, 2024
1 parent 64121e1 commit fa635ad
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,6 @@ jobs:
- name: Check results
run: |
echo "All previous jobs have completed successfully!"
- name: Notify in Teams on failure
if: failure()
uses: ./.github/workflows/smoke-test-webhook.yml
63 changes: 63 additions & 0 deletions .github/workflows/smoke-test-failure-webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 'ci: smoke test failure webhook'

on:
push:
branches:
- build/smoketest-webhook

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Post failure in Teams channel
env:
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
REPO_NAME: ${{ github.repository }}
BRANCH_NAME: ${{ github.ref }}
COMMIT_SHA: ${{ github.sha }}
RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
run: |
curl -H 'Content-Type: application/json' -d '{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "Build Failure Notification"
},
{
"type": "FactSet",
"facts": [
{
"title": "Repository",
"value": "'"${REPO_NAME}"'"
},
{
"title": "Branch",
"value": "'"${BRANCH_NAME}"'"
},
{
"title": "Commit",
"value": "'"${COMMIT_SHA}"'"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "View failed run",
"url": "'"${RUN_URL}"'"
}
]
}
}
]
}' "$TEAMS_WEBHOOK_URL"

0 comments on commit fa635ad

Please sign in to comment.