Skip to content
Merged
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
26 changes: 21 additions & 5 deletions .github/workflows/report-scheduled-failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
# if: ${{ always() && github.event_name == 'schedule' && contains(needs.*.result, 'failure') }}
# permissions:
# issues: write # required: a called workflow can only downgrade permissions
# uses: FalkorDB/.github/.github/workflows/report-scheduled-failure.yml@main
# secrets: inherit
# uses: FalkorDB/.github/.github/workflows/report-scheduled-failure.yml@<full commit sha>
# secrets:
# DRIVERS_GOOGLE_CHAT_WEBHOOK_URL: ${{ secrets.DRIVERS_GOOGLE_CHAT_WEBHOOK_URL }}
#
# Pin to a full commit SHA rather than a branch: `secrets: inherit` and mutable
# refs together would let any later change here run with the caller's secrets.
# Dependabot's github-actions ecosystem updates `jobs.<id>.uses` pins, so the
# clients still get changes made here without hand-editing eight workflows.
Comment on lines +21 to +24
#
# The `github` context always belongs to the caller, so the repository, workflow
# name and run URL below are the calling repo's without being passed in.
Expand Down Expand Up @@ -71,17 +77,27 @@ jobs:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TITLE: ${{ inputs.issue-title }}
LABEL: nightly-edge-failure
run: |
body=$(printf '%s\n' \
"The daily \`$WORKFLOW\` run against \`falkordb/falkordb:edge\` failed." \
"" \
"$RUN_URL" \
"" \
"Set the \`DRIVERS_GOOGLE_CHAT_WEBHOOK_URL\` secret to receive this in Google Chat instead.")
number=$(gh issue list --state open --search "$TITLE in:title" --json number,title \
--jq "map(select(.title == \"$TITLE\")) | .[0].number // empty")
gh label create "$LABEL" --force \
--color d93f0b --description "Nightly CI run against falkordb/falkordb:edge is failing"
Comment on lines +88 to +89
# Find the issue by label rather than `--search`: the search index is
# only eventually consistent, so two failures in quick succession
# would each open their own issue. Label filtering goes through the
# GraphQL listing instead and sees the issue immediately.
#
# The title is matched via the environment rather than spliced into
# the jq program, which a title containing a quote would break.
number=$(gh issue list --state open --label "$LABEL" --limit 100 \
--json number,title --jq 'map(select(.title == env.TITLE)) | .[0].number // empty')
if [ -n "$number" ]; then
gh issue comment "$number" --body "$body"
else
gh issue create --title "$TITLE" --body "$body"
gh issue create --title "$TITLE" --body "$body" --label "$LABEL"
fi