@@ -342,3 +342,50 @@ jobs:
342342 - name : Test tor connections using lightning-net-tokio
343343 run : |
344344 TOR_PROXY="127.0.0.1:9050" RUSTFLAGS="--cfg=tor" cargo test --verbose --color always -p lightning-net-tokio
345+
346+ notify-failure :
347+ needs : [build, fuzz, linting, rustfmt, check_release, check_docs, benchmark, ext-test, tor-connect, coverage]
348+ if : failure() && github.ref == 'refs/heads/main'
349+ runs-on : ubuntu-latest
350+ permissions :
351+ issues : write
352+ steps :
353+ - name : Create or update failure issue
354+ env :
355+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
356+ GH_REPO : ${{ github.repository }}
357+ run : |
358+ LABEL="build failed"
359+ TITLE="Failed build: ${{ github.workflow }}"
360+ RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
361+ REPO_URL="https://github.com/${{ github.repository }}"
362+ COMMITTER="${{ github.event.head_commit.author.username }}"
363+ BODY="GitHub Actions workflow [${{ github.workflow }} #${{ github.run_number }}](${RUN_URL}) failed."
364+ BODY="${BODY}"$'\n\n'"Event: ${{ github.event_name }}"
365+ BRANCH="${{ github.ref_name }}"
366+ BODY="${BODY}"$'\n'"Branch: [${BRANCH}](${REPO_URL}/tree/${BRANCH})"
367+ BODY="${BODY}"$'\n'"Commit: [${{ github.sha }}](${REPO_URL}/commit/${{ github.sha }})"
368+ if [ -n "$COMMITTER" ]; then
369+ BODY="${BODY}"$'\n'"Committer: @${COMMITTER}"
370+ fi
371+
372+ # Ensure label exists
373+ if ! gh label list --search "$LABEL" --json name --jq '.[].name' | grep -qxF "$LABEL"; then
374+ gh label create "$LABEL"
375+ fi
376+
377+ # Find existing open issue with this label
378+ ISSUE_NUMBER=$(gh issue list --label "$LABEL" --state open --json number --jq '.[0].number // empty')
379+
380+ if [ -n "$ISSUE_NUMBER" ]; then
381+ gh issue comment "$ISSUE_NUMBER" --body "$BODY"
382+ else
383+ ISSUE_URL=$(gh issue create --title "$TITLE" --label "$LABEL" --body "$BODY")
384+ ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -o '[0-9]*$')
385+ fi
386+
387+ # Assign issue to committer if no one is assigned yet
388+ ASSIGNEE_COUNT=$(gh issue view "$ISSUE_NUMBER" --json assignees --jq '.assignees | length')
389+ if [ "$ASSIGNEE_COUNT" = "0" ] && [ -n "$COMMITTER" ]; then
390+ gh issue edit "$ISSUE_NUMBER" --add-assignee "$COMMITTER" || true
391+ fi
0 commit comments