certbot/.github/workflows/notify_nightly.yml
ohemorange 750b9997de
Some checks failed
PR test suite / Standard tests (push) Has been cancelled
PR test suite / PR test suite success (push) Has been cancelled
Upgrade action-mattermost-notify action to use node 24 (#10647)
Makes the warnings about the upcoming Node 20 deprecation go away.
2026-05-19 13:07:31 -07:00

59 lines
1.8 KiB
YAML

name: Notify nightly failure
on:
workflow_call:
secrets:
MATTERMOST_PUBLIC_CERTBOT_CHANNEL_WEBHOOK:
required: true
permissions:
actions: read
jobs:
notify_mattermost:
name: Notify mattermost
runs-on: ubuntu-latest
steps:
- name: Calculate duration
shell: bash
id: duration
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |-
START=$(gh run view "$GITHUB_RUN_ID" --json startedAt --jq ".startedAt")
START_SECONDS=$(date -d"$START" +%s)
NOW_SECONDS=$(date +%s)
DURATION=$(date -d@"$((NOW_SECONDS - START_SECONDS))" -u +%H:%M:%S)
echo "result = $DURATION"
echo "result=$DURATION" >> "$GITHUB_OUTPUT"
- name: Send to mattermost
uses: mattermost/action-mattermost-notify@ae31bb6f9e26a54336e79696f108a2c91cf55b4e
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_PUBLIC_CERTBOT_CHANNEL_WEBHOOK }}
PAYLOAD: |-
{
"attachments": [
{
"color": "danger",
"fields": [
null,
{
"title": "Duration",
"value": "${{ steps.duration.outputs.result }}",
"short": true
},
{
"title": "Workflow",
"value": "nightly",
"short": true
}
],
"pretext": "Run <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}> failed",
"mrkdwn_in": [
"pretext"
],
"fallback": "Run ${{ github.run_id }} failed https://github.com/certbot/actions/runs/${{ github.run_id }}"
}
]
}