Skip to content

Add CI job to report main branch build failures via GitHub issues#4418

Open
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:main-fail-issue
Open

Add CI job to report main branch build failures via GitHub issues#4418
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:main-fail-issue

Conversation

@joostjager
Copy link
Contributor

@joostjager joostjager commented Feb 13, 2026

Adds a notify-failure job to the main CI workflow (build.yml) that automatically creates a GitHub issue when the main branch build fails. The job uses inline gh CLI commands (no third-party action dependency) to create or comment on an issue labeled "build failed". It triggers on main branch pushes when at least one job in build.yml has failed.

The job depends on all existing jobs in build.yml and runs after they complete. If any job fails, it either creates a new issue with the "build failed" label or adds a comment to an existing open issue with that label. Each comment includes the workflow run link, event, branch, commit, and committer (as an @-mention). Closing the issue signals the problem is resolved; subsequent failures will create a fresh issue. The first committer whose push triggers a failure is assigned to the issue; subsequent failures that add comments do not reassign.

Note that this only covers jobs in build.yml. Other workflows that run on main pushes (semver.yml, ldk-node-integration.yml) are not covered yet, as GitHub Actions needs cannot cross workflow boundaries. Expanding coverage would require some restructuring (e.g., converting them to reusable workflows or duplicating the notification job).

Permissions are scoped to issues: write only, so the token cannot be used to push code, modify workflows, or access secrets.

Tested on the main branch of my fork by deliberately breaking the build. The action successfully created an issue: joostjager#7

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 13, 2026

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@joostjager
Copy link
Contributor Author

joostjager commented Feb 13, 2026

For ldk-node-integration.yml it might be simpler to just duplicate the notification job there, since it's a standalone integration test that doesn't share any dependencies with the other CI jobs...

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.08%. Comparing base (0b45bfd) to head (3a61ec2).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4418      +/-   ##
==========================================
+ Coverage   86.07%   86.08%   +0.01%     
==========================================
  Files         156      156              
  Lines      103442   103623     +181     
  Branches   103442   103623     +181     
==========================================
+ Hits        89033    89200     +167     
- Misses      11894    11907      +13     
- Partials     2515     2516       +1     
Flag Coverage Δ
tests 86.08% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joostjager joostjager marked this pull request as ready for review February 16, 2026 13:43
- uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b # v1.2.0
id: create-issue
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow restrict this to only opening new issues?

Copy link
Contributor Author

@joostjager joostjager Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it can be more granular than "issues: write", which also allows updating. That is useful to amend an already existing, unresolved, build issue.

- name: Assign issue to committer
if: steps.create-issue.outputs.issue-number
run: |
gh issue edit ${{ steps.create-issue.outputs.issue-number }} \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can use the standard github tooling can we just use gh issue create instead of jayqi/failed-build-issue-action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Automatically creates or comments on a "build failed" issue when any CI
job fails on the main branch, and assigns it to the committer who
triggered the failure. Uses inline gh CLI commands to avoid a
third-party action dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants