Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 54 additions & 54 deletions .github/workflows/test-podman-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,60 +123,60 @@ jobs:
- name: Send GitHub Actions Run Status Adaptive Card to Teams via Power Automate
if: github.event_name == 'schedule' && always()
run: | # zizmor: ignore[template-injection]
STATUS="Success"
if [ "${{ job.status }}" != "success" ]; then
STATUS="Failure"
fi

RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
}
}
}
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
else
echo "Job status is success. No notification will be sent."
fi
108 changes: 54 additions & 54 deletions .github/workflows/test-run-dev-version-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,60 +115,60 @@ jobs:
- name: Send GitHub Actions Run Status Adaptive Card to Teams via Power Automate
if: github.event_name == 'schedule' && always()
run: | # zizmor: ignore[template-injection]
STATUS="Success"
if [ "${{ job.status }}" != "success" ]; then
STATUS="Failure"
fi

RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
}
}
}
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
else
echo "Job status is success. No notification will be sent."
fi
1 change: 1 addition & 0 deletions doc/changelog.d/4561.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Notify only when job fails