GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Log error for non-default `analysis-kinds` input outside of managed workflows by mbg · Pull Request #3895 · github/codeql-action

Conversation

@mbg

@mbg mbg commented May 13, 2026

Copy link
Copy Markdown
Member

The analysis-kinds input is for internal-use only and non-default arguments outside of GitHub-managed workflows are not supported. This PR logs an error if we detect that a (meaningful) value other than code-scanning (the default) is provided, along with instructions for the intended way of enabling e.g. other queries.

Risk assessment

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

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Workflow types:

  • Advanced setup - Impacts users who have custom CodeQL workflows.

Products:

  • Code Quality - The changes impact analyses when analysis-kinds: code-quality.

Environments:

  • Dotcom - Impacts CodeQL workflows on github.com and/or GitHub Enterprise Cloud with Data Residency.
  • GHES - Impacts CodeQL workflows on GitHub Enterprise Server.

How did/will you validate this change?

  • 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?

  • 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.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
Log error for non-default analysis-kinds input outside of managed w…
4235601
…orkflows
@mbg
mbg requested a review from henrymercer May 13, 2026 16:48
@mbg mbg self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 16:48
@mbg
mbg requested a review from a team as a code owner May 13, 2026 16:48
@github-actions github-actions Bot added the size/S Should be easy to review label May 13, 2026
Copilot started reviewing on behalf of mbg May 13, 2026 16:49
View session
Copilot AI reviewed May 13, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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 adds a clearer runtime error log when the internal-only analysis-kinds input is set to a non-default value in non–GitHub-managed (custom/advanced) workflows, and refactors test utilities to make it easier to set up Actions-like environment variables in unit tests.

Changes:

  • Log an error outside of test mode when analysis-kinds enables anything other than code-scanning in non-managed workflows (detected via non-dynamic event).
  • Centralize the “internal-only / experimental” analysis-kinds preamble into a shared helper for consistent messaging.
  • Split test env setup into setupBaseActionsVars vs. setupActionsVars, and update tests accordingly.
Show a summary per file
File Description
src/testing-utils.ts Introduces setupBaseActionsVars and a shared override type to simplify environment setup in unit tests.
src/analyses.ts Adds custom-workflow detection and logs an error for non-default analysis-kinds; refactors repeated error prefix into a helper.
src/analyses.test.ts Updates tests to set required Actions env vars and adds coverage for the new “custom vs managed workflow” logging behavior.
lib/setup-codeql-action.js Generated output updated to reflect the TypeScript changes.
lib/init-action.js Generated output updated to reflect the TypeScript changes.

Copilot's findings

  • Files reviewed: 3/5 changed files
  • Comments generated: 0

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
henrymercer
henrymercer previously approved these changes May 19, 2026
View reviewed changes
Comment thread src/analyses.test.ts Outdated
Comment on lines +129 to +131
!logger.hasMessage(
"An analysis kind other than `code-scanning` was specified in a custom workflow.",
),

@henrymercer henrymercer May 19, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nit, optional: this isn't robust to the message changing slightly — it would be more robust to assert what is logged.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
Merge remote-tracking branch 'origin/main' into mbg/analysis-kinds/wa…
b79a976
…rn-on-non-cs-advanced-setup
@mbg
mbg dismissed henrymercer’s stale review via b79a976 May 19, 2026 13:18
@mbg
Assert that nothing is logged
0a7280a
@mbg
mbg requested a review from henrymercer May 19, 2026 13:22
henrymercer
henrymercer approved these changes May 19, 2026
View reviewed changes
@mbg
mbg added this pull request to the merge queue May 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 19, 2026

Uh oh!

There was an error while loading. Please reload this page.

@henrymercer
henrymercer added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit f62fbc9 May 19, 2026
225 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@henrymercer
henrymercer deleted the mbg/analysis-kinds/warn-on-non-cs-advanced-setup branch May 19, 2026 18:55
This was referenced May 22, 2026
Merge main into releases/v4 #3927
Merged
Merge releases/v4 into releases/v3 #3929
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@henrymercer henrymercer henrymercer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mbg mbg

Labels

size/S Should be easy to review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @henrymercer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.