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 — Consistently format YAML and add CI check by mbg · Pull Request #4280 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Oct 30, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Improves some YAML-related project configuration, adds prettier as a dev dependency along with a command to use it to format YAML files in the repository. Also adds a CI check to ensure that the YAML files are correctly formatted, which is done with a cherry-picked change from #4064 that converts check-js.sh to TypeScript that is then extended to be able to run checks for either JS or YAML.

Notes for reviewers

  • The formatting/checking is done using prettier, which we already have configured for TypeScript in .vscode/settings.json.
  • The PR updates some project configuration files to make sure that prettier is used consistently and using consistent settings.
  • The PR bumps prettier to the latest version (at the time of writing), which causes some minor TypeScript formatting changes.
  • All of the YAML files are formatted using prettier and sync.ts is updated to emit compatible formatting where that wasn't already the case. This simplifies sync.ts a bit.
  • There's also a change to some production code in src/analyze.ts for diffRangeExtensionPackContents which constructs a YAML file using string concatenation. I think ideally we'd update this to just build the required object and then have one call to YAML.dump, but I didn't want to change this more than necessary.
    • This change was needed because we have a YAML file in the repo with the expected output from this, and which is now subject to the formatting requirements. We could manually exclude that file instead.

Sorry, something went wrong.

Uh oh!

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

All reactions
Copilot AI auto review requested due to automatic review settings October 30, 2026 12:45
@mbg
mbg requested a review from a team as a code owner October 30, 2026 12:45
Copilot started reviewing on behalf of mbg October 30, 2026 12:46
View session
Copilot AI reviewed Oct 30, 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.

🟡 Changes recommended

A byte-for-byte fixture mismatch risks CI test failures, while dirty-checkout handling and a Node 20-incompatible entry-point guard can silently bypass required checks.

4 open issues
  • High severity Formatted fixture no longer matches generated output · New
  • Medium severity Dirty checkout incorrectly skips rebuild and formatting · New
  • Medium severity Failure summaries are not written before exit · New
  • Medium severity Compiled-JS check is skipped on Node 20 · New
58 files not reviewed
  • .github/workflows/__all-platform-bundle.yml: Excluded by your content exclusion settings
  • .github/workflows/__analysis-kinds.yml: Excluded by your content exclusion settings
  • .github/workflows/__analyze-ref-input.yml: Excluded by your content exclusion settings
  • .github/workflows/__autobuild-action.yml: Excluded by your content exclusion settings
  • .github/workflows/__autobuild-direct-tracing-with-working-dir.yml: Excluded by your content exclusion settings
  • .github/workflows/__autobuild-working-dir.yml: Excluded by your content exclusion settings
  • .github/workflows/__build-mode-autobuild.yml: Excluded by your content exclusion settings
  • .github/workflows/__build-mode-manual.yml: Excluded by your content exclusion settings
  • .github/workflows/__build-mode-none.yml: Excluded by your content exclusion settings
  • .github/workflows/__build-mode-rollback.yml: Excluded by your content exclusion settings
  • .github/workflows/__bundle-from-nightly.yml: Excluded by your content exclusion settings
  • .github/workflows/__bundle-from-toolcache.yml: Excluded by your content exclusion settings
  • .github/workflows/__bundle-toolcache.yml: Excluded by your content exclusion settings
  • .github/workflows/__cleanup-db-cluster-dir.yml: Excluded by your content exclusion settings
  • .github/workflows/__config-export.yml: Excluded by your content exclusion settings
  • .github/workflows/__config-input.yml: Excluded by your content exclusion settings
  • .github/workflows/__cpp-deptrace-disabled.yml: Excluded by your content exclusion settings
  • .github/workflows/__cpp-deptrace-enabled-on-macos.yml: Excluded by your content exclusion settings
  • .github/workflows/__cpp-deptrace-enabled.yml: Excluded by your content exclusion settings
  • .github/workflows/__diagnostics-export.yml: Excluded by your content exclusion settings

And 38 more.

What changed in this PR

This PR standardizes YAML formatting across the CodeQL Action repository and adds CI enforcement, extending the TypeScript CI-script migration from #4064.

Changes:

  • Adds Prettier, a YAML formatting command, and editor configuration.
  • Replaces the JavaScript verification shell script with a shared TypeScript checker for JavaScript and YAML.
  • Normalizes YAML formatting and adjusts workflow generation to use double quotes.
File Description
upload-sarif/​action.yml Normalizes YAML quoting.
tsconfig.json Excludes the Prettier configuration from compilation.
tests/​multi-language-repo/​codeql-qlpacks/​python-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​codeql-qlpacks/​javascript-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​codeql-qlpacks/​java-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​codeql-qlpacks/​go-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​codeql-qlpacks/​csharp-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​codeql-qlpacks/​cpp-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​codeql-qlpacks/​complex-python-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​codeql-qlpacks/​complex-javascript-qlpack/​qlpack.yml Adds a final newline.
tests/​multi-language-repo/​.github/​codeql/​custom-queries.yml Aligns comments with query entries.
tests/​multi-language-repo/​.github/​codeql/​codeql-config-query-filters3.yml Normalizes indentation and spacing.
tests/​multi-language-repo/​.github/​codeql/​codeql-config-query-filters2.yml Normalizes filter indentation.
tests/​multi-language-repo/​.github/​codeql/​codeql-config-query-filters1.yml Normalizes filter indentation.
src/​testdata/​pr-diff-range.yml Formats the diff-range fixture.
setup-codeql/​action.yml Normalizes YAML quoting.
resolve-environment/​action.yml Normalizes YAML quoting.
prettier.config.mts Sets the formatter’s print width.
pr-checks/​update-release-branch.ts Imports extracted command helpers.
pr-checks/​sync.ts Uses double quotes in generated YAML.
pr-checks/​config.ts Exports shared repository paths.
pr-checks/​command.ts Houses shared command and Git helpers.
pr-checks/​checks/​upload-sarif.yml Normalizes input quoting.
pr-checks/​checks/​upload-ref-sha-input.yml Normalizes input quoting.
pr-checks/​checks/​overlay-init-fallback.yml Normalizes inline-comment spacing.
pr-checks/​checks/​init-with-registries.yml Normalizes block-scalar indentation.
pr-checks/​checks/​analyze-ref-input.yml Normalizes input quoting.
pr-checks/​check-unchanged.ts Adds shared JavaScript and YAML verification.
package.json Adds Prettier and the formatting command.
package-lock.json Records the Prettier dependency update.
init/​action.yml Normalizes YAML quoting.
eslint.config.mjs Excludes the Prettier configuration from linting.
autobuild/​action.yml Normalizes YAML quoting.
action.yml Normalizes stub-action quoting.
.vscode/​settings.json Configures YAML formatting in VS Code.
.github/​workflows/​update-supported-enterprise-server-versions.yml Normalizes cache-input quoting.
.github/​workflows/​update-release-branch.yml Normalizes indentation and comment spacing.
.github/​workflows/​update-bundle.yml Normalizes YAML quoting.
.github/​workflows/​test-codeql-bundle-all.yml Normalizes indentation and quoting.
.github/​workflows/​script/​check-js.sh Removes the replaced shell checker.
.github/​workflows/​rebuild.yml Normalizes cache-input quoting.
.github/​workflows/​query-filters.yml Normalizes indentation, quoting, and spacing.
.github/​workflows/​python312-windows.yml Normalizes indentation and schedule quoting.
.github/​workflows/​publish-immutable-action.yml Normalizes name and tag-pattern quoting.
.github/​workflows/​pr-checks.yml Invokes the TypeScript checker for both formats.
.github/​workflows/​post-release-mergeback.yml Normalizes quoting and comment spacing.
.github/​workflows/​codescanning-config-cli.yml Normalizes indentation and quoting.
.github/​workflows/​codeql.yml Normalizes indentation and matrix formatting.
.github/​ISSUE_TEMPLATE/​config.yml Removes trailing whitespace.
.github/​actions/​release-initialise/​action.yml Normalizes quoting and spacing.
.github/​actions/​release-branches/​action.yml Normalizes metadata quoting.
.github/​actions/​query-filter-test/​action.yml Removes extra input spacing.
.github/​actions/​check-codescanning-config/​action.yml Normalizes indentation and quoting.
.editorconfig Adds a YAML indentation section.

Review effort: Balanced (auto)

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/testdata/pr-diff-range.yml Resolved

Uh oh!

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

Comment thread pr-checks/check-unchanged.ts Resolved

Uh oh!

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

Comment thread pr-checks/check-unchanged.ts Resolved

Uh oh!

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

Comment thread pr-checks/check-unchanged.ts Resolved

Uh oh!

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

@github-actions github-actions Bot added the size/XL May be very hard to review label Oct 30, 2026
@mbg
mbg force-pushed the mbg/ci/validate-yaml branch from 40a548c to fa95e87 Compare October 30, 2026 15:04
mbg added 13 commits October 30, 2026 15:13
@mbg
Update .editorconfig with explicit indent_size for YAML
d805a56
@mbg
Update VSCode settings with YAML formatter
3f9319d
@mbg
Add prettier as dev dependency
fef5200
@mbg
Apply consistent YAML formatting
2c6d525
@mbg
Move subprocess helpers from update-release-branch.ts to command.ts
6c2d540
@mbg
Convert check-js.sh to TypeScript
c8db21e
@mbg
Refactor check-js.ts into separate functions
549d739
@mbg
Rename to check-unchanged and add YAML check
b2e3b75
@mbg
Fix checkUnchanged returning -1
ff6ba28
@mbg
Fix missing core.summary.write call
c434c1b
@mbg
Fix inconsistent quoting in diffRangeExtensionPackContents and empt…
878c513
…y initial line
@mbg
Configure VSCode to use local version of prettier
69543ab
@mbg
Run lint-fix with newer version of prettier
fab591c
@mbg
mbg force-pushed the mbg/ci/validate-yaml branch from fa95e87 to fab591c Compare October 30, 2026 15:34
mbg added 4 commits October 30, 2026 17:41
@mbg
Avoid ESM-specific entry check for now
9fe80b6
@mbg
Merge branch 'main' into mbg/ci/validate-yaml
9151e90
@mbg
Merge remote-tracking branch 'origin/main' into mbg/ci/validate-yaml
70417cd
@mbg
Merge branch 'main' into mbg/ci/validate-yaml
7bcfa1e
@mbg
mbg requested a review from henrymercer November 3, 2026 13:42
henrymercer
henrymercer reviewed Nov 4, 2026
View reviewed changes
Comment thread .editorconfig Resolved

Uh oh!

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

Comment thread pr-checks/sync.ts
Comment on lines 371 to 375
const yamlStr = yaml.stringify(workflowDoc, {
aliasDuplicateObjects: false,
singleQuote: true,
singleQuote: false,
lineWidth: 0,
});

@henrymercer henrymercer Nov 4, 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.

Is it worth running this through prettier.format?

Sorry, something went wrong.

Uh oh!

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

All reactions

@mbg mbg Nov 4, 2026

Copy link
Copy Markdown
Member Author

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.

Maybe, but as far as I can tell the formatting that comes out of here and the prettier expectations are fairly well aligned. We could look at doing this if we find that it's a problem in the future.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread tsconfig.json Resolved

Uh oh!

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

Comment thread pr-checks/check-unchanged.ts Resolved

Uh oh!

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

mbg added 4 commits November 4, 2026 11:56
@mbg
Merge remote-tracking branch 'origin/main' into mbg/ci/validate-yaml
160e547
@mbg
Use normal .editorconfig pattern
8eb7cdf
@mbg
Remove exclude entry that's no longer needed
7287bb3
@mbg
Return different exit code when a language is not recognised
cea289b
henrymercer
henrymercer approved these changes Nov 4, 2026
View reviewed changes
@mbg
mbg enabled auto-merge November 4, 2026 12:07
@mbg
mbg added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 8cd4dfa Nov 4, 2026
231 checks passed

Uh oh!

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

@mbg
mbg deleted the mbg/ci/validate-yaml branch November 4, 2026 12:29
This was referenced Nov 4, 2026
Merge main into releases/v4 #4299
Merged
Merge releases/v4 into releases/v3 #4304
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

No one assigned

Labels

size/XL May be very hard 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 01402503 — 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.