Skip to content

Summary labels policy-routed findings as 'GitHub could not post this as an inline comment' #2071

Backlog

Description

@ranokay

Summary

When route_severity_below or route_categories moves a finding to the sticky summary, the summary labels it as a posting failure:

⚠️ GitHub could not post this as an inline comment: Routed to summary (severity medium · category bug)

GitHub didn't fail to post anything. The publication policy routed the finding on purpose. Readers take the warning to mean the run partly failed.

Where

scripts/github-actions/post-review-comments.js on main:

  • formatSummaryComment (about line 2407) prints ⚠️ GitHub could not post this as an inline comment: ${error} for every summary entry that has a reason.
  • routeFinding (about line 2364) passes Routed to summary (…) as that reason, so routed findings get the failure wording.
  • The no-line case (NO_LINE_REASON) uses the same line on purpose. It isn't a GitHub failure either.

Reproduce

Action v1.14.0 with route_severity_below: medium on a PR that yields a medium finding. The summary shows the warning above with Comments routed: 1 and Comments failed: 0.

Suggested fix

Use a different line per cause, for example:

  • routed: ℹ️ Routed to the summary by policy (severity medium · category bug), or just the badge with no line;
  • no line info: ℹ️ No line range, so shown here;
  • real failures: keep ⚠️ GitHub could not post this as an inline comment: <error>.

The counters already tell routed and failed apart (comments_routed and comments_failed). Only the per-finding line merges them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions