Skip to content

Conversation

@mbg
Copy link
Member

@mbg mbg commented Oct 14, 2025

This replaces the two calls to uploadFiles in the analyze action with one call to uploadSarif. We introduced uploadSarif in #3167 for the upload-sarif action. Using uploadSarif here means that we no longer use different implementations of the same logic in analyze and upload-sarif.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk:

Which use cases does this change impact?

  • Advanced setup - Impacts users who have custom workflows.
  • Default setup - Impacts users who use default setup.
  • Code Scanning - Impacts Code Scanning (i.e. analysis-kinds: code-scanning).
  • Code Quality - Impacts Code Quality (i.e. analysis-kinds: code-quality).
  • GHES - Impacts GitHub Enterprise Server.

How did/will you validate this change?

  • Test repository - This change will be tested on a test repository before merging.
  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).
  • End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • FF
  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.

How will you know if something goes wrong after this change is released?

  • Telemetry - I rely on existing telemetry or have made changes to the telemetry.
    • Dashboards - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
    • Alerts - New or existing monitors will trip if something goes wrong with this change.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

@mbg mbg requested a review from a team as a code owner October 14, 2025 18:53
@mbg mbg marked this pull request as draft October 14, 2025 18:56
@mbg mbg marked this pull request as ready for review October 21, 2025 22:54
Copilot AI review requested due to automatic review settings October 21, 2025 22:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the analyze action to use the uploadSarif function instead of making separate calls to uploadFiles for Code Scanning and Code Quality analyses. The change consolidates SARIF upload logic that was previously duplicated between the analyze and upload-sarif actions.

Key changes:

  • Replaces two separate uploadFiles calls with a single uploadSarif call that handles both Code Scanning and Code Quality uploads
  • Changes the upload result tracking from a single UploadResult to a record mapping analysis kinds to their respective results
  • Updates all references to the upload results throughout the action to access the appropriate analysis kind

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/analyze-action.ts Refactors upload logic to use uploadSarif and updates result handling to work with grouped results by analysis kind
lib/analyze-action.js Generated JavaScript code reflecting the TypeScript changes, including new helper functions for SARIF file grouping

@github-actions github-actions bot added the size/S Should be easy to review label Oct 21, 2025
esbena
esbena previously approved these changes Oct 22, 2025
Copy link
Contributor

@esbena esbena left a comment

Choose a reason for hiding this comment

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

LGTM, with one optional code style comment.

esbena
esbena previously approved these changes Oct 22, 2025
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

This looks good. Thanks for adding the feature flag. I think you can update the classification in the PR description to low risk now.

@mbg mbg merged commit 4264208 into main Oct 22, 2025
250 of 251 checks passed
@mbg mbg deleted the mbg/analyze/use-upload-sarif branch October 22, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Should be easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants