Skip to content

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

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
Collaborator

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 while granting permissions to read CI logs and comment on pull requests. Pinning the action to an immutable commit is required to prevent future action changes or compromise from affecting the workflow.

No automated validation is included for the workflow’s trigger, permissions, or isolation behavior.

About this PR

  • Add automated validation for the workflow’s event filtering, permissions, and non-checkout behavior.

Test suggestions

  • Verify the workflow triggers only for failed completions of the CI workflow.
  • Verify the workflow invokes whatbroke with sufficient permissions to read logs and comment on pull requests.
  • Verify the workflow operates without checking out pull-request code.
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 sufficient permissions to read logs and comment on pull requests.
3. Verify the workflow operates without checking out pull-request 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. Automated coverage for event filtering, permissions, non-checkout behavior, and comment ordering is still absent.

Test suggestions

  • Verify a failed CI workflow_run triggers the explain job.
  • Verify successful CI runs and unrelated workflow runs do not trigger the job.
  • Verify the workflow grants only the required actions-read and pull-request-write permissions and does not check out code.
  • Verify the action comments with the new failure log lines in the expected order.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify a failed CI workflow_run triggers the explain job.
2. Verify successful CI runs and unrelated workflow runs do not trigger the job.
3. Verify the workflow grants only the required actions-read and pull-request-write permissions and does not check out code.
4. Verify the action comments with the new failure log lines in the expected order.

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 dcd58cb into main Nov 15, 2026
10 checks passed
@ranjan-mohanty
ranjan-mohanty deleted the whatbroke branch November 15, 2026 23:07
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