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
15 changes: 14 additions & 1 deletion .github/workflows/release-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ jobs:
if: failure()
runs-on: ubuntu-latest
timeout-minutes: 2
permissions: {}
permissions:
actions: read
defaults:
run:
shell: bash
Expand All @@ -114,6 +115,7 @@ jobs:
PUBLICATION_RESULT: ${{ needs.publish.result }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_OPENSHELL_TRIAGE_WEBHOOK_URL }}
SLACK_MENTION: ${{ secrets.SLACK_OPENSHELL_TRIAGE_MENTION }}
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ format('{0}/{1}/actions/runs/{2}/attempts/{3}', github.server_url, github.repository, github.run_id, github.run_attempt) }}
run: |
set -euo pipefail
Expand All @@ -129,6 +131,17 @@ jobs:
if [[ -n "${SLACK_MENTION}" ]]; then
message+=" ${SLACK_MENTION}"
fi

failed_jobs=$(gh api --paginate \
"repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}/jobs?per_page=100" \
--jq '.jobs[] | select(.conclusion == "failure" or .conclusion == "timed_out") | "• <\(.html_url)|\(.name)>"') || {
echo "::warning::Could not list failed jobs; sending the notification without them."
failed_jobs=""
}
if [[ -n "${failed_jobs}" ]]; then
message+=$'\n\nFailed jobs\n'"${failed_jobs}"
fi

jq -n --arg text "${message}" --arg run_url "${RUN_URL}" \
'{text: ($text + "\n<" + $run_url + "|View failed release run>"), unfurl_links: false, unfurl_media: false}' |
curl --fail --silent --show-error --connect-timeout 5 --max-time 15 \
Expand Down
2 changes: 1 addition & 1 deletion CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ reviewed and accepted for v0.1.0 and will be addressed in 0.1.x releases.
Scanner failures still fail qualification.

Failed pre-release builds, publication, or qualification send notifications via Slack using a webhook and
at-mentioning the triage engineer with a link to the failure. The webhook is
at-mentioning the triage engineer, with links to each failed job and to the run. The webhook is
stored in the repository secret `SLACK_OPENSHELL_TRIAGE_WEBHOOK_URL` and the
mention is stored in the repository secret `SLACK_OPENSHELL_TRIAGE_MENTION`.
Successful pre-release builds post a top-level message to the same webhook
Expand Down
Loading