Skip to content

Add whatbroke: explain failed CI runs on the PR - #1

Merged
ranjan-mohanty merged 2 commits into
mainfrom
whatbroke
Nov 15, 2026
Merged

ranjan-mohanty merged 2 commits into
mainfrom
whatbroke

Conversation

@ranjan-mohanty

Copy link
Copy Markdown
Contributor

When the CI workflow fails, whatbroke comments on the pull request with only the log lines that weren't in the last passing run, failure first.

  • Runs as its own workflow (workflow_run), so it also works for PRs from forks and never checks out their code.
  • Permissions: actions: read (logs) and pull-requests: write (the comment).
  • It starts working once this is merged: workflow_run workflows only run from the default branch.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

⚠️ Resolve issues before merging

The workflow uses a mutable third-party action reference in a privileged context with permission to read logs and modify pull requests. This should be pinned to a verified full commit SHA before merging to prevent unreviewed upstream changes from executing with those permissions.

Test suggestions

  • Verify a failed CI workflow_run invokes whatbroke with sufficient permissions to read logs and comment on the pull request.
  • Verify successful CI runs do not invoke the explanatory job.
  • Verify the workflow can process fork pull requests without checking out or executing repository code.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify a failed CI workflow_run invokes whatbroke with sufficient permissions to read logs and comment on the pull request.
2. Verify successful CI runs do not invoke the explanatory job.
3. Verify the workflow can process fork pull requests without checking out or executing repository code.

TIP Add a Jira or Linear ticket key to the branch or title so the reviewer can check the PR against it. Using another tracker? Tell us.
TIP How was this review? Give us feedback

Comment thread .github/workflows/whatbroke.yml Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

✅ No blocking issues noticed

No blocking findings were identified in this review. The recommended workflow behavior remains unverified by automated tests, including trigger filtering, permissions and checkout independence, and log-diff ordering.

Test suggestions

  • Verify the workflow triggers only for failed completions of the CI workflow.
  • Verify the workflow invokes whatbroke with actions-read and pull-request-write permissions and no code checkout.
  • Verify whatbroke reports only new log lines and orders failure output first.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the workflow triggers only for failed completions of the CI workflow.
2. Verify the workflow invokes whatbroke with actions-read and pull-request-write permissions and no code checkout.
3. Verify whatbroke reports only new log lines and orders failure output first.

TIP Add a Jira or Linear ticket key to the branch or title so the reviewer can check the PR against it. Using another tracker? Tell us.
TIP How was this review? Give us feedback

@ranjan-mohanty
ranjan-mohanty merged commit fca4e50 into main Nov 15, 2026
7 checks passed
@ranjan-mohanty
ranjan-mohanty deleted the whatbroke branch November 15, 2026 23:09
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.

1 participant