Compare commits

...

51 Commits

Author SHA1 Message Date
Sam Robson
0911ee96d2 Merge pull request #4303 from github/mergeback/v4.39.3-to-main-33d7b85d
Mergeback v4.39.3 refs/heads/releases/v4 into main
2026-11-04 17:52:12 +00:00
github-actions[bot]
d11b2246b1 Rebuild 2026-11-04 16:49:37 +00:00
github-actions[bot]
8e42d3873f Update changelog and version after v4.39.3 2026-11-04 16:49:21 +00:00
Sam Robson
33d7b85da1 Merge pull request #4299 from github/update-v4.39.3-064910ba2
Merge main into releases/v4
2026-11-04 16:47:01 +00:00
Michael B. Gale
8aab3d8601 Merge pull request #4298 from github/mbg/decouple-features-enum
Move `Feature` enum to a separate file
2026-11-04 15:50:28 +00:00
github-actions[bot]
24393f8692 Update changelog for v4.39.3 2026-11-04 15:21:56 +00:00
Michael B. Gale
064910ba27 Merge pull request #4297 from github/mbg/update-glob
Update `glob` to `14.0.3`
2026-11-04 13:56:56 +00:00
Michael B. Gale
29ddace71d Move Feature enum to a separate file 2026-11-04 13:14:15 +00:00
Michael B. Gale
f532ac5951 Update glob to 14.0.3 2026-11-04 13:08:55 +00:00
Michael B. Gale
8cd4dfa419 Merge pull request #4280 from github/mbg/ci/validate-yaml
Consistently format YAML and add CI check
2026-11-04 12:16:33 +00:00
Michael B. Gale
cea289b432 Return different exit code when a language is not recognised 2026-11-04 11:58:17 +00:00
Michael B. Gale
7287bb3627 Remove exclude entry that's no longer needed 2026-11-04 11:57:34 +00:00
Michael B. Gale
8eb7cdf7ab Use normal .editorconfig pattern 2026-11-04 11:57:07 +00:00
Michael B. Gale
160e5474d2 Merge remote-tracking branch 'origin/main' into mbg/ci/validate-yaml 2026-11-04 11:56:23 +00:00
Sam Robson
913e1bb775 Merge pull request #4283 from github/sam-robson/decode-diff-informed-sarif-uris
fix: decode SARIF location URIs in diff-informed alert filtering
2026-11-03 19:47:09 +00:00
Michael B. Gale
c5320e3a8a Merge pull request #4288 from github/dependabot/npm_and_yarn/node-forge-1.4.1
Bump node-forge from 1.4.0 to 1.4.1
2026-11-03 15:53:37 +00:00
Michael B. Gale
875ac0c36c Merge pull request #4287 from github/dependabot/npm_and_yarn/pr-checks/glob-14.0.3
Bump glob from 13.0.6 to 14.0.3 in /pr-checks
2026-11-03 15:49:12 +00:00
github-actions[bot]
d0468de4ad Rebuild 2026-11-03 15:38:38 +00:00
Michael B. Gale
6a39e2e9cd Merge branch 'main' into dependabot/npm_and_yarn/pr-checks/glob-14.0.3 2026-11-03 15:36:40 +00:00
Michael B. Gale
7c5ee8eaaf Merge branch 'main' into dependabot/npm_and_yarn/node-forge-1.4.1 2026-11-03 15:33:20 +00:00
Michael B. Gale
1f8cacc390 Merge pull request #4292 from github/mbg/ci/fix-sync-back
Maintain action versions by workflow in `sync-back.ts`
2026-11-03 14:27:13 +00:00
Michael B. Gale
8a05ce6067 Update JSDoc for scanGeneratedWorkflows 2026-11-03 13:41:11 +00:00
Michael B. Gale
7bcfa1eeee Merge branch 'main' into mbg/ci/validate-yaml 2026-11-03 12:59:48 +00:00
Michael B. Gale
de3ece651e Merge branch 'main' into mbg/ci/fix-sync-back 2026-11-03 12:58:27 +00:00
Michael B. Gale
cc88e02cc1 Update version of actions/download-artifact in unsupported-macos for consistency 2026-11-03 12:34:09 +00:00
Michael B. Gale
7b8e4ced67 Maintain action versions by workflow in sync-back.ts
This avoids failures on PRs where `sync-back.ts` is run as part of the "Rebuild" job if there are already version inconsistencies on the base branch.
2026-11-03 12:34:09 +00:00
Henry Mercer
093c0af4c3 Merge pull request #4290 from github/mergeback/v4.39.2-to-main-1fc58d04
Mergeback v4.39.2 refs/heads/releases/v4 into main
2026-11-03 11:09:56 +00:00
github-actions[bot]
30626207b6 Rebuild 2026-11-03 10:46:49 +00:00
github-actions[bot]
eb1e5bd7ab Update changelog and version after v4.39.2 2026-11-03 10:46:39 +00:00
dependabot[bot]
dc4b73f464 Bump node-forge from 1.4.0 to 1.4.1
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.4.0 to 1.4.1.
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-version: 1.4.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-03 10:27:23 +00:00
dependabot[bot]
3b22011a97 Bump glob from 13.0.6 to 14.0.3 in /pr-checks
Bumps [glob](https://github.com/isaacs/node-glob) from 13.0.6 to 14.0.3.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v13.0.6...v14.0.3)

---
updated-dependencies:
- dependency-name: glob
  dependency-version: 14.0.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-03 10:27:18 +00:00
Henry Mercer
0d5ac7a9b1 Merge pull request #4285 from github/henrymercer/automated-change-notes
Migrate bundle update workflow to new changenote tooling
2026-11-03 10:13:30 +00:00
Michael B. Gale
70417cd0ad Merge remote-tracking branch 'origin/main' into mbg/ci/validate-yaml 2026-11-03 10:10:17 +00:00
Henry Mercer
39528452cf Remove unused updateChangelog from bundle-changelog.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-02 17:40:43 +00:00
Henry Mercer
9bc74b13fb Create a changenote for bundle updates instead of editing the changelog
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-02 17:40:43 +00:00
Sam Robson
b05fe69863 fix: decode SARIF location URIs in diff-informed alert filtering 2026-11-02 16:04:35 +00:00
Michael B. Gale
9151e9044f Merge branch 'main' into mbg/ci/validate-yaml 2026-11-02 12:15:05 +00:00
Michael B. Gale
9fe80b66a8 Avoid ESM-specific entry check for now 2026-10-30 17:41:30 +00:00
Michael B. Gale
fab591c88b Run lint-fix with newer version of prettier 2026-10-30 15:33:51 +00:00
Michael B. Gale
69543ab913 Configure VSCode to use local version of prettier 2026-10-30 15:33:51 +00:00
Michael B. Gale
878c513e47 Fix inconsistent quoting in diffRangeExtensionPackContents and empty initial line 2026-10-30 15:33:51 +00:00
Michael B. Gale
c434c1b9e4 Fix missing core.summary.write call 2026-10-30 15:33:51 +00:00
Michael B. Gale
ff6ba28d13 Fix checkUnchanged returning -1 2026-10-30 15:33:51 +00:00
Michael B. Gale
b2e3b75374 Rename to check-unchanged and add YAML check 2026-10-30 15:33:50 +00:00
Michael B. Gale
549d739b5f Refactor check-js.ts into separate functions 2026-10-30 15:33:50 +00:00
Michael B. Gale
c8db21e0dc Convert check-js.sh to TypeScript 2026-10-30 15:33:50 +00:00
Michael B. Gale
6c2d54079d Move subprocess helpers from update-release-branch.ts to command.ts 2026-10-30 15:33:50 +00:00
Michael B. Gale
2c6d525faa Apply consistent YAML formatting 2026-10-30 15:33:50 +00:00
Michael B. Gale
fef52000cc Add prettier as dev dependency 2026-10-30 15:33:49 +00:00
Michael B. Gale
3f9319d27c Update VSCode settings with YAML formatter 2026-10-30 15:13:51 +00:00
Michael B. Gale
d805a561ae Update .editorconfig with explicit indent_size for YAML 2026-10-30 15:13:51 +00:00
129 changed files with 4037 additions and 2962 deletions

View File

@@ -8,3 +8,6 @@ trim_trailing_whitespace = true
[*.ts]
indent_style = space
indent_size = 2
[*.{yml,yaml}]
indent_size = 2

View File

@@ -2,4 +2,4 @@ blank_issues_enabled: true
contact_links:
- name: Contact GitHub Support
url: https://support.github.com/request
about: Contact Support
about: Contact Support

View File

@@ -1,7 +1,7 @@
name: Check Code-Scanning Config
description: |
Checks the code scanning configuration file generated by the
action to ensure it contains the expected contents
Checks the code scanning configuration file generated by the
action to ensure it contains the expected contents
inputs:
languages:
required: false
@@ -52,7 +52,7 @@ runs:
tools: ${{ inputs.tools }}
db-location: ${{ runner.temp }}/codescanning-config-cli-test
env:
CODEQL_ACTION_TEST_MODE: 'true'
CODEQL_ACTION_TEST_MODE: "true"
- name: Install dependencies
shell: bash
@@ -62,7 +62,7 @@ runs:
working-directory: ${{ github.action_path }}
shell: bash
env:
EXPECTED_CONFIG_FILE_CONTENTS: '${{ inputs.expected-config-file-contents }}'
EXPECTED_CONFIG_FILE_CONTENTS: "${{ inputs.expected-config-file-contents }}"
run: ts-node ./index.ts "$RUNNER_TEMP/user-config.yaml" "$EXPECTED_CONFIG_FILE_CONTENTS"
- name: Clean up
shell: bash

View File

@@ -54,7 +54,7 @@ runs:
- name: Check SARIF
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ inputs.sarif-file }}
sarif-file: ${{ inputs.sarif-file }}
queries-run: ${{ inputs.queries-run}}
queries-not-run: ${{ inputs.queries-not-run}}
- name: Cleanup after test

View File

@@ -1,11 +1,11 @@
name: 'Release branches'
description: 'Determine branches for release & backport'
name: "Release branches"
description: "Determine branches for release & backport"
inputs:
major_version:
description: 'The version as extracted from the package.json file'
description: "The version as extracted from the package.json file"
required: true
latest_tag:
description: 'The most recent tag published to the repository'
description: "The most recent tag published to the repository"
required: true
outputs:
backport_source_branch:

View File

@@ -1,17 +1,16 @@
name: 'Prepare release job'
description: 'Prepare for updating a release branch'
name: "Prepare release job"
description: "Prepare for updating a release branch"
runs:
using: "composite"
steps:
- name: Dump environment
run: env
shell: bash
- name: Dump GitHub context
env:
GITHUB_CONTEXT: '${{ toJson(github) }}'
GITHUB_CONTEXT: "${{ toJson(github) }}"
run: echo "$GITHUB_CONTEXT"
shell: bash
@@ -19,7 +18,7 @@ runs:
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'npm'
cache: "npm"
- name: Install JavaScript dependencies
shell: bash

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -84,8 +84,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'true'
setup-kotlin: 'true'
use-all-platform-bundle: "true"
setup-kotlin: "true"
- id: init
uses: ./../action/init
with:

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -73,8 +73,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: javascript
@@ -82,16 +82,16 @@ jobs:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
post-processed-sarif-path: '${{ runner.temp }}/post-processed'
post-processed-sarif-path: "${{ runner.temp }}/post-processed"
- name: Upload SARIF files
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: |
analysis-kinds-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}
path: '${{ runner.temp }}/results/*.sarif'
path: "${{ runner.temp }}/results/*.sarif"
retention-days: 7
- name: Upload post-processed SARIF
@@ -99,7 +99,7 @@ jobs:
with:
name: |
post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}
path: '${{ runner.temp }}/post-processed'
path: "${{ runner.temp }}/post-processed"
retention-days: 7
if-no-files-found: error
@@ -107,16 +107,16 @@ jobs:
if: contains(matrix.analysis-kinds, 'code-scanning')
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
SARIF_PATH: '${{ runner.temp }}/results/javascript.sarif'
EXPECT_PRESENT: 'false'
SARIF_PATH: "${{ runner.temp }}/results/javascript.sarif"
EXPECT_PRESENT: "false"
with:
script: ${{ env.CHECK_SCRIPT }}
- name: Check quality query appears in quality SARIF
if: contains(matrix.analysis-kinds, 'code-quality')
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
SARIF_PATH: '${{ runner.temp }}/results/javascript.quality.sarif'
EXPECT_PRESENT: 'true'
SARIF_PATH: "${{ runner.temp }}/results/javascript.quality.sarif"
EXPECT_PRESENT: "true"
with:
script: ${{ env.CHECK_SCRIPT }}
env:

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -80,8 +80,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -91,7 +91,7 @@ jobs:
run: ./build.sh
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -69,8 +69,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: csharp
@@ -78,12 +78,12 @@ jobs:
- uses: ./../action/autobuild
env:
# Explicitly disable the CLR tracer.
COR_ENABLE_PROFILING: ''
COR_PROFILER: ''
COR_PROFILER_PATH_64: ''
CORECLR_ENABLE_PROFILING: ''
CORECLR_PROFILER: ''
CORECLR_PROFILER_PATH_64: ''
COR_ENABLE_PROFILING: ""
COR_PROFILER: ""
COR_PROFILER_PATH_64: ""
CORECLR_ENABLE_PROFILING: ""
CORECLR_PROFILER: ""
CORECLR_PROFILER_PATH_64: ""
- uses: ./../action/analyze
- name: Check database
run: |

View File

@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
default: "17"
workflow_call:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
default: "17"
defaults:
run:
shell: bash
@@ -72,8 +72,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Test setup
run: |
# Make sure that Gradle build succeeds in autobuild-dir ...

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -51,8 +51,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Test setup
run: |
# Make sure that Gradle build succeeds in autobuild-dir ...

View File

@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
default: "17"
workflow_call:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
default: "17"
defaults:
run:
shell: bash
@@ -80,8 +80,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Set up Java test repo configuration
run: |
mv * .github ../action/tests/multi-language-repo/
@@ -92,7 +92,7 @@ jobs:
id: init
with:
build-mode: autobuild
db-location: '${{ runner.temp }}/customDbLocation'
db-location: "${{ runner.temp }}/customDbLocation"
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -80,13 +80,13 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:
build-mode: manual
db-location: '${{ runner.temp }}/customDbLocation'
db-location: "${{ runner.temp }}/customDbLocation"
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -53,13 +53,13 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:
build-mode: none
db-location: '${{ runner.temp }}/customDbLocation'
db-location: "${{ runner.temp }}/customDbLocation"
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -51,8 +51,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Set up Java test repo configuration
run: |
mv * .github ../action/tests/multi-language-repo/
@@ -63,7 +63,7 @@ jobs:
id: init
with:
build-mode: none
db-location: '${{ runner.temp }}/customDbLocation'
db-location: "${{ runner.temp }}/customDbLocation"
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Bundle: From nightly'
name: "PR Check - Bundle: From nightly"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -36,7 +36,7 @@ jobs:
include:
- os: ubuntu-26.04
version: linked
name: 'Bundle: From nightly'
name: "Bundle: From nightly"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -51,8 +51,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- id: init
uses: ./../action/init
env:

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Bundle: From toolcache'
name: "PR Check - Bundle: From toolcache"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -36,7 +36,7 @@ jobs:
include:
- os: ubuntu-26.04
version: toolcache
name: 'Bundle: From toolcache'
name: "Bundle: From toolcache"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -60,8 +60,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Check toolcache contains CodeQL
continue-on-error: true
run: |

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Bundle: Caching checks'
name: "PR Check - Bundle: Caching checks"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -40,7 +40,7 @@ jobs:
version: linked
- os: windows-2025
version: linked
name: 'Bundle: Caching checks'
name: "Bundle: Caching checks"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -64,8 +64,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Remove CodeQL from toolcache
run: |
cd ./../action

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -51,8 +51,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Add a file to the database cluster directory
run: |
mkdir -p "${{ runner.temp }}/customDbLocation/javascript"
@@ -62,7 +62,7 @@ jobs:
id: init
with:
build-mode: none
db-location: '${{ runner.temp }}/customDbLocation'
db-location: "${{ runner.temp }}/customDbLocation"
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -53,8 +53,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: javascript
@@ -62,18 +62,18 @@ jobs:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: '${{ runner.temp }}/results/javascript.sarif'
path: "${{ runner.temp }}/results/javascript.sarif"
retention-days: 7
- name: Check config properties appear in SARIF
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
SARIF_PATH: '${{ runner.temp }}/results/javascript.sarif'
SARIF_PATH: "${{ runner.temp }}/results/javascript.sarif"
with:
script: |
const fs = require('fs');

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -60,8 +60,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Copy queries into workspace
run: |
cp -a ../action/queries .

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - C/C++: disabling autoinstalling dependencies (Linux)'
name: "PR Check - C/C++: disabling autoinstalling dependencies (Linux)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -40,7 +40,7 @@ jobs:
version: default
- os: ubuntu-26.04
version: nightly-latest
name: 'C/C++: disabling autoinstalling dependencies (Linux)'
name: "C/C++: disabling autoinstalling dependencies (Linux)"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -55,8 +55,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Test setup
run: |
cp -a ../action/tests/cpp-autobuild autobuild-dir
@@ -75,5 +75,5 @@ jobs:
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
CODEQL_ACTION_TEST_MODE: true

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - C/C++: autoinstalling dependencies is skipped (macOS)'
name: "PR Check - C/C++: autoinstalling dependencies is skipped (macOS)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -38,7 +38,7 @@ jobs:
version: linked
- os: macos-26
version: nightly-latest
name: 'C/C++: autoinstalling dependencies is skipped (macOS)'
name: "C/C++: autoinstalling dependencies is skipped (macOS)"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -53,8 +53,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Test setup
run: |
cp -a ../action/tests/cpp-autobuild autobuild-dir
@@ -75,5 +75,5 @@ jobs:
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
CODEQL_ACTION_TEST_MODE: true

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - C/C++: autoinstalling dependencies (Linux)'
name: "PR Check - C/C++: autoinstalling dependencies (Linux)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -40,7 +40,7 @@ jobs:
version: default
- os: ubuntu-26.04
version: nightly-latest
name: 'C/C++: autoinstalling dependencies (Linux)'
name: "C/C++: autoinstalling dependencies (Linux)"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -55,8 +55,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Test setup
run: |
cp -a ../action/tests/cpp-autobuild autobuild-dir
@@ -75,5 +75,5 @@ jobs:
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
CODEQL_ACTION_TEST_MODE: true

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -62,8 +62,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:
@@ -82,18 +82,18 @@ jobs:
--ready-for-status-page
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: '${{ runner.temp }}/results/javascript.sarif'
path: "${{ runner.temp }}/results/javascript.sarif"
retention-days: 7
- name: Check diagnostics appear in SARIF
env:
SARIF_PATH: '${{ runner.temp }}/results/javascript.sarif'
SARIF_PATH: "${{ runner.temp }}/results/javascript.sarif"
run: |
cd ../action
npx tsx ./pr-checks/check-diagnostics.ts

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -67,8 +67,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Initialise failing analysis
id: init
uses: ./../action/init
@@ -87,11 +87,11 @@ jobs:
# `category` input. Without this step, that part of the init post-action would fail.
if: false
with:
category: '/test-codeql-version:${{ matrix.version }}'
category: "/test-codeql-version:${{ matrix.version }}"
- name: Check diagnostics appear on disk
env:
DIAGNOSTICS_DIR: '${{ runner.temp }}/codeql-action-temp-diagnostics/'
DIAGNOSTICS_DIR: "${{ runner.temp }}/codeql-action-temp-diagnostics/"
run: |
cd ../action
npx tsx ./pr-checks/diagnostics-without-db.ts

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -84,8 +84,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:
@@ -100,12 +100,12 @@ jobs:
run: ./build.sh
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
- name: Upload SARIF
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: '${{ runner.temp }}/results/javascript.sarif'
path: "${{ runner.temp }}/results/javascript.sarif"
retention-days: 7
- name: Check results
run: |

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -51,8 +51,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: java

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -53,8 +53,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'false'
use-all-platform-bundle: "false"
setup-kotlin: "false"
- name: Block direct internet access to force proxy usage
run: |
apt-get update -qq && apt-get install -y -qq iptables >/dev/null 2>&1

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: Custom queries'
name: "PR Check - Go: Custom queries"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -58,7 +58,7 @@ jobs:
version: linked
- os: ubuntu-26.04
version: nightly-latest
name: 'Go: Custom queries'
name: "Go: Custom queries"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -82,8 +82,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: go
@@ -93,5 +93,5 @@ jobs:
run: ./build.sh
- uses: ./../action/analyze
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
CODEQL_ACTION_TEST_MODE: true

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: diagnostic when Go is changed after init step'
name: "PR Check - Go: diagnostic when Go is changed after init step"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -46,7 +46,7 @@ jobs:
include:
- os: ubuntu-26.04
version: default
name: 'Go: diagnostic when Go is changed after init step'
name: "Go: diagnostic when Go is changed after init step"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -66,8 +66,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: go
@@ -75,17 +75,17 @@ jobs:
# Deliberately change Go after the `init` step
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: '1.20'
go-version: "1.20"
- name: Build code
run: go build main.go
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Check diagnostic appears in SARIF
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
SARIF_PATH: '${{ runner.temp }}/results/go.sarif'
SARIF_PATH: "${{ runner.temp }}/results/go.sarif"
with:
script: |
const fs = require('fs');

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: diagnostic when `file` is not installed'
name: "PR Check - Go: diagnostic when `file` is not installed"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -46,7 +46,7 @@ jobs:
include:
- os: ubuntu-26.04
version: default
name: 'Go: diagnostic when `file` is not installed'
name: "Go: diagnostic when `file` is not installed"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -66,8 +66,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Remove `file` program
run: |
echo $(which file)
@@ -81,12 +81,12 @@ jobs:
run: go build main.go
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Check diagnostic appears in SARIF
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
SARIF_PATH: '${{ runner.temp }}/results/go.sarif'
SARIF_PATH: "${{ runner.temp }}/results/go.sarif"
with:
script: |
const fs = require('fs');

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: workaround for indirect tracing'
name: "PR Check - Go: workaround for indirect tracing"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -46,7 +46,7 @@ jobs:
include:
- os: ubuntu-26.04
version: default
name: 'Go: workaround for indirect tracing'
name: "Go: workaround for indirect tracing"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -66,8 +66,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: go

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: tracing with autobuilder step'
name: "PR Check - Go: tracing with autobuilder step"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -66,7 +66,7 @@ jobs:
version: nightly-latest
- os: macos-26
version: nightly-latest
name: 'Go: tracing with autobuilder step'
name: "Go: tracing with autobuilder step"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -86,8 +86,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: go
@@ -106,5 +106,5 @@ jobs:
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
CODEQL_ACTION_TEST_MODE: true

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: tracing with custom build steps'
name: "PR Check - Go: tracing with custom build steps"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -66,7 +66,7 @@ jobs:
version: nightly-latest
- os: macos-26
version: nightly-latest
name: 'Go: tracing with custom build steps'
name: "Go: tracing with custom build steps"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -86,8 +86,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: go

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: tracing with legacy workflow'
name: "PR Check - Go: tracing with legacy workflow"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,21 +17,21 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -66,7 +66,7 @@ jobs:
version: nightly-latest
- os: macos-26
version: nightly-latest
name: 'Go: tracing with legacy workflow'
name: "Go: tracing with legacy workflow"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -86,8 +86,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: go
@@ -100,5 +100,5 @@ jobs:
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
CODEQL_ACTION_TEST_MODE: true

16
.github/workflows/__go.yml generated vendored
View File

@@ -19,10 +19,10 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
jobs:
go-custom-queries:
name: 'Go: Custom queries'
name: "Go: Custom queries"
permissions:
contents: read
security-events: read
@@ -31,7 +31,7 @@ jobs:
dotnet-version: ${{ inputs.dotnet-version }}
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround-diagnostic:
name: 'Go: diagnostic when Go is changed after init step'
name: "Go: diagnostic when Go is changed after init step"
permissions:
contents: read
security-events: read
@@ -39,7 +39,7 @@ jobs:
with:
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround-no-file-program:
name: 'Go: diagnostic when `file` is not installed'
name: "Go: diagnostic when `file` is not installed"
permissions:
contents: read
security-events: read
@@ -47,7 +47,7 @@ jobs:
with:
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround:
name: 'Go: workaround for indirect tracing'
name: "Go: workaround for indirect tracing"
permissions:
contents: read
security-events: read
@@ -55,7 +55,7 @@ jobs:
with:
go-version: ${{ inputs.go-version }}
go-tracing-autobuilder:
name: 'Go: tracing with autobuilder step'
name: "Go: tracing with autobuilder step"
permissions:
contents: read
security-events: read
@@ -63,7 +63,7 @@ jobs:
with:
go-version: ${{ inputs.go-version }}
go-tracing-custom-build-steps:
name: 'Go: tracing with custom build steps'
name: "Go: tracing with custom build steps"
permissions:
contents: read
security-events: read
@@ -71,7 +71,7 @@ jobs:
with:
go-version: ${{ inputs.go-version }}
go-tracing-legacy-workflow:
name: 'Go: tracing with legacy workflow'
name: "Go: tracing with legacy workflow"
permissions:
contents: read
security-events: read

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Packaging: Download using registries'
name: "PR Check - Packaging: Download using registries"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -40,7 +40,7 @@ jobs:
version: linked
- os: ubuntu-26.04
version: nightly-latest
name: 'Packaging: Download using registries'
name: "Packaging: Download using registries"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -55,12 +55,12 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Init with registries
uses: ./../action/init
with:
db-location: '${{ runner.temp }}/customDbLocation'
db-location: "${{ runner.temp }}/customDbLocation"
tools: ${{ steps.prepare-test.outputs.tools-url }}
config-file: ./.github/codeql/codeql-config-registries.yml
languages: javascript

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -55,8 +55,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Move codeql-action
run: |
mkdir ../new-source-root

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -51,8 +51,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:
@@ -60,12 +60,12 @@ jobs:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
- name: Upload SARIF
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: '${{ runner.temp }}/results/javascript.sarif'
path: "${{ runner.temp }}/results/javascript.sarif"
retention-days: 7
- name: Check results
run: |

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -51,14 +51,14 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: C#,java-kotlin,typescript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: 'Check languages'
- name: "Check languages"
run: |
expected_languages="csharp,java,javascript"
actual_languages=$(jq -r '.languages | join(",")' "$RUNNER_TEMP"/config)

10
.github/workflows/__linux-arm64.yml generated vendored
View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -80,8 +80,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: ${{ env.LANGUAGES }}

10
.github/workflows/__local-bundle.yml generated vendored
View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -80,8 +80,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Fetch latest CodeQL bundle
run: |
wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.zst

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -114,8 +114,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Install Python 3.13.15 for older CLI versions
# Older CLI versions don't work with Python 3.13.16 or newer because their Python extractor
# imports `importlib._bootstrap._ERR_MSG`, which those Python versions no longer define.
@@ -123,7 +123,7 @@ jobs:
if: matrix.version != 'nightly-latest' && matrix.version != 'linked'
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.13.15'
python-version: "3.13.15"
- name: Use Xcode 16
# Only the older CodeQL CLI versions need Xcode 16, and these run on macOS 15.
@@ -133,7 +133,7 @@ jobs:
- uses: ./../action/init
id: init
with:
db-location: '${{ runner.temp }}/customDbLocation'
db-location: "${{ runner.temp }}/customDbLocation"
languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby' || '' }}
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -53,8 +53,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: actions # Any language without overlay support will do

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Packaging: Config and input passed to the CLI'
name: "PR Check - Packaging: Config and input passed to the CLI"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -60,7 +60,7 @@ jobs:
version: default
- os: ubuntu-26.04
version: nightly-latest
name: 'Packaging: Config and input passed to the CLI'
name: "Packaging: Config and input passed to the CLI"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -93,11 +93,11 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
config-file: '.github/codeql/codeql-config-packaging3.yml'
config-file: ".github/codeql/codeql-config-packaging3.yml"
packs: +codeql-testing/codeql-pack1@1.0.0
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -105,7 +105,7 @@ jobs:
run: ./build.sh
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Check results

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Packaging: Config and input'
name: "PR Check - Packaging: Config and input"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -60,7 +60,7 @@ jobs:
version: default
- os: ubuntu-26.04
version: nightly-latest
name: 'Packaging: Config and input'
name: "Packaging: Config and input"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -93,11 +93,11 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
config-file: '.github/codeql/codeql-config-packaging3.yml'
config-file: ".github/codeql/codeql-config-packaging3.yml"
packs: +codeql-testing/codeql-pack1@1.0.0
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -105,7 +105,7 @@ jobs:
run: ./build.sh
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Check results

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Packaging: Config file'
name: "PR Check - Packaging: Config file"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -60,7 +60,7 @@ jobs:
version: default
- os: ubuntu-26.04
version: nightly-latest
name: 'Packaging: Config file'
name: "Packaging: Config file"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -93,18 +93,18 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
config-file: '.github/codeql/codeql-config-packaging.yml'
config-file: ".github/codeql/codeql-config-packaging.yml"
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Check results

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Packaging: Action input'
name: "PR Check - Packaging: Action input"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -60,7 +60,7 @@ jobs:
version: default
- os: ubuntu-26.04
version: nightly-latest
name: 'Packaging: Action input'
name: "Packaging: Action input"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -93,11 +93,11 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
config-file: '.github/codeql/codeql-config-packaging2.yml'
config-file: ".github/codeql/codeql-config-packaging2.yml"
languages: javascript
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2, codeql-testing/codeql-pack3:other-query.ql
tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -105,7 +105,7 @@ jobs:
run: ./build.sh
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
- name: Check results
uses: ./../action/.github/actions/check-sarif

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -95,8 +95,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Remove CodeQL from toolcache
run: |
cd ./../action

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -82,8 +82,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -55,8 +55,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: go,javascript-typescript

6
.github/workflows/__ruby.yml generated vendored
View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -61,8 +61,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: ruby

6
.github/workflows/__rust.yml generated vendored
View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -59,8 +59,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
languages: rust

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -90,11 +90,11 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
config-file: '.github/codeql/codeql-config-packaging3.yml'
config-file: ".github/codeql/codeql-config-packaging3.yml"
packs: +codeql-testing/codeql-pack1@1.0.0
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -103,7 +103,7 @@ jobs:
- uses: ./../action/analyze
with:
skip-queries: true
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Assert No Results
@@ -114,7 +114,7 @@ jobs:
fi
- uses: ./../action/analyze
with:
output: '${{ runner.temp }}/results'
output: "${{ runner.temp }}/results"
upload-database: false
- name: Assert Results
run: |

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -55,8 +55,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Setup proxy for registries
id: proxy
uses: ./../action/start-proxy
@@ -101,5 +101,5 @@ jobs:
tools: ${{ steps.prepare-test.outputs.tools-url }}
config-file: codeql-action@main:tests/multi-language-repo/.github/codeql/custom-queries.yml
env:
CODEQL_ACTION_PROXY_API_REQUESTS: 'true'
CODEQL_ACTION_PROXY_API_REQUESTS: "true"
CODEQL_ACTION_TEST_MODE: true

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -55,8 +55,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./init
with:
@@ -76,7 +76,7 @@ jobs:
# `category` input. Without this step, that part of the init post-action would fail.
if: false
with:
category: '/test-codeql-version:${{ matrix.version }}'
category: "/test-codeql-version:${{ matrix.version }}"
env:
CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF: true
CODEQL_ACTION_UPLOAD_FAILED_SARIF: true

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -51,8 +51,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -84,8 +84,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:
@@ -107,5 +107,5 @@ jobs:
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
CODEQL_ACTION_TEST_MODE: true

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -82,8 +82,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
id: init
with:

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs: {}
workflow_call:
@@ -62,8 +62,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Check xcode_select_link
run: |
readlink /private/var/db/xcode_select_link
@@ -86,7 +86,7 @@ jobs:
if: false
uses: ./analyze
with:
category: '/test-codeql-version:${{ matrix.version }}'
category: "/test-codeql-version:${{ matrix.version }}"
env:
CODEQL_ACTION_SKIP_GENERATE_FAILED_SARIF: false
CODEQL_ACTION_SKIP_SARIF_UPLOAD: true
@@ -114,7 +114,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Download workflow artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: test-mode-sarif-*
path: sarif

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -80,8 +80,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -92,12 +92,12 @@ jobs:
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
upload: never
- uses: ./../action/upload-sarif
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
env:
CODEQL_ACTION_TEST_MODE: true

40
.github/workflows/__upload-sarif.yml generated vendored
View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -87,8 +87,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -99,8 +99,8 @@ jobs:
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
upload: never
output: ${{ runner.temp }}/results
@@ -109,15 +109,15 @@ jobs:
uses: ./../action/upload-sarif
id: upload-sarif
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:all-files/
- name: 'Fail for missing output from `upload-sarif` step for `code-scanning`'
- name: "Fail for missing output from `upload-sarif` step for `code-scanning`"
if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-scanning)
run: exit 1
- name: 'Fail for missing output from `upload-sarif` step for `code-quality`'
- name: "Fail for missing output from `upload-sarif` step for `code-quality`"
if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)
run: exit 1
@@ -126,12 +126,12 @@ jobs:
id: upload-single-sarif-code-scanning
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results/javascript.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-scanning/
- name: 'Fail for missing output from `upload-single-sarif-code-scanning` step'
- name: "Fail for missing output from `upload-single-sarif-code-scanning` step"
if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-sarif-code-scanning.outputs.sarif-ids).code-scanning)
run: exit 1
- name: Upload single SARIF file for Code Quality
@@ -139,12 +139,12 @@ jobs:
id: upload-single-sarif-code-quality
if: contains(matrix.analysis-kinds, 'code-quality')
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results/javascript.quality.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-quality/
- name: 'Fail for missing output from `upload-single-sarif-code-quality` step'
- name: "Fail for missing output from `upload-single-sarif-code-quality` step"
if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-single-sarif-code-quality.outputs.sarif-ids).code-quality)
run: exit 1
@@ -156,12 +156,12 @@ jobs:
id: upload-single-non-sarif
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results/javascript.sarif.json
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:non-sarif/
- name: 'Fail for missing output from `upload-single-non-sarif` step'
- name: "Fail for missing output from `upload-single-non-sarif` step"
if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-non-sarif.outputs.sarif-ids).code-scanning)
run: exit 1
env:

View File

@@ -17,7 +17,7 @@ on:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
dotnet-version:
@@ -29,7 +29,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
workflow_call:
inputs:
dotnet-version:
@@ -41,7 +41,7 @@ on:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
default: ">=1.21.0"
defaults:
run:
shell: bash
@@ -81,8 +81,8 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
use-all-platform-bundle: "false"
setup-kotlin: "true"
- name: Delete original checkout
run: |
# delete the original checkout so we don't accidentally use it.

View File

@@ -8,7 +8,7 @@ on:
types: [checks_requested]
schedule:
# Weekly on Sunday.
- cron: '30 1 * * 0'
- cron: "30 1 * * 0"
workflow_dispatch:
defaults:
@@ -32,41 +32,41 @@ jobs:
security-events: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up default CodeQL bundle
id: setup-default
uses: ./setup-codeql
- name: Set up linked CodeQL bundle
id: setup-linked
uses: ./setup-codeql
with:
tools: linked
- name: Compare default and linked CodeQL bundle versions
id: compare
env:
CODEQL_DEFAULT: ${{ steps.setup-default.outputs.codeql-path }}
CODEQL_LINKED: ${{ steps.setup-linked.outputs.codeql-path }}
run: |
CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)"
CODEQL_VERSION_LINKED="$("$CODEQL_LINKED" version --format terse)"
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
echo "Linked CodeQL bundle version is $CODEQL_VERSION_LINKED"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up default CodeQL bundle
id: setup-default
uses: ./setup-codeql
- name: Set up linked CodeQL bundle
id: setup-linked
uses: ./setup-codeql
with:
tools: linked
- name: Compare default and linked CodeQL bundle versions
id: compare
env:
CODEQL_DEFAULT: ${{ steps.setup-default.outputs.codeql-path }}
CODEQL_LINKED: ${{ steps.setup-linked.outputs.codeql-path }}
run: |
CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)"
CODEQL_VERSION_LINKED="$("$CODEQL_LINKED" version --format terse)"
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
echo "Linked CodeQL bundle version is $CODEQL_VERSION_LINKED"
# If we're running on a pull request, run with both bundles, even if `tools: linked` would
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
# required status check.
#
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be
# the same as running with `tools: null`.
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LINKED" ]]; then
VERSIONS_JSON='[null]'
else
VERSIONS_JSON='[null, "linked"]'
fi
# If we're running on a pull request, run with both bundles, even if `tools: linked` would
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
# required status check.
#
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be
# the same as running with `tools: null`.
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LINKED" ]]; then
VERSIONS_JSON='[null]'
else
VERSIONS_JSON='[null, "linked"]'
fi
# Output a JSON-encoded list with the distinct versions to test against.
echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT
# Output a JSON-encoded list with the distinct versions to test against.
echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT
analyze-javascript:
if: github.triggering_actor != 'dependabot[bot]'
@@ -74,7 +74,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-14-xlarge,macos-15-xlarge]
os:
- ubuntu-22.04
- ubuntu-24.04
- windows-2022
- windows-2025
- macos-14-xlarge
- macos-15-xlarge
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
runs-on: ${{ matrix.os }}
@@ -83,26 +89,26 @@ jobs:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: ./init
id: init
with:
languages: javascript
config-file: ./.github/codeql/codeql-config-javascript.yml
tools: ${{ matrix.tools }}
# confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version
run: >
"$CODEQL" version --format=json
env:
CODEQL: ${{steps.init.outputs.codeql-path}}
- name: Perform CodeQL Analysis
uses: ./analyze
with:
category: "/language:javascript"
upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && github.event_name != 'merge_group' && 'always' ) || 'never' }}
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: ./init
id: init
with:
languages: javascript
config-file: ./.github/codeql/codeql-config-javascript.yml
tools: ${{ matrix.tools }}
# confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version
run: >
"$CODEQL" version --format=json
env:
CODEQL: ${{steps.init.outputs.codeql-path}}
- name: Perform CodeQL Analysis
uses: ./analyze
with:
category: "/language:javascript"
upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && github.event_name != 'merge_group' && 'always' ) || 'never' }}
analyze-other:
if: github.triggering_actor != 'dependabot[bot]'
@@ -119,21 +125,21 @@ jobs:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: ./init
with:
languages: ${{ matrix.language }}
build-mode: none
config: >
paths-ignore:
- lib
- tests
queries:
- uses: security-and-quality
- name: Perform CodeQL Analysis
uses: ./analyze
with:
category: "/language:${{ matrix.language }}"
upload: ${{ (github.event_name != 'merge_group' && 'always') || 'never' }}
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: ./init
with:
languages: ${{ matrix.language }}
build-mode: none
config: >
paths-ignore:
- lib
- tests
queries:
- uses: security-and-quality
- name: Perform CodeQL Analysis
uses: ./analyze
with:
category: "/language:${{ matrix.language }}"
upload: ${{ (github.event_name != 'merge_group' && 'always') || 'never' }}

View File

@@ -10,13 +10,13 @@ env:
on:
push:
branches:
- main
- releases/v*
- main
- releases/v*
pull_request:
merge_group:
types: [checks_requested]
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
concurrency:
@@ -41,187 +41,187 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-26.04
version: linked
- os: ubuntu-26.04
version: default
- os: ubuntu-26.04
version: nightly-latest
- os: ubuntu-26.04
version: linked
- os: ubuntu-26.04
version: default
- os: ubuntu-26.04
version: nightly-latest
# Code-Scanning config not created because environment variable is not set
name: Code Scanning Configuration tests
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'npm'
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm ci
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Empty file
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: "{}"
# Request multiple languages so later checks can reuse the combined bundle.
languages: javascript,python
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Empty file
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: "{}"
# Request multiple languages so later checks can reuse the combined bundle.
languages: javascript,python
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Packs from input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Packs from input with +
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries from input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }]
}
languages: javascript
queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries from input with +
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }]
}
languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from input with +
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }],
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from config
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }],
"packs": {
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
- name: Packs from input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
}
languages: javascript
config-file-test: .github/codeql/queries-and-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: javascript
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from config overriden by input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }],
"packs": ["codeql/javascript-queries"]
}
languages: javascript
queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
packs: codeql/javascript-queries
config-file-test: .github/codeql/queries-and-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Packs from input with +
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from config merging with input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": {
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2", "codeql/javascript-queries" ]
},
"queries": [
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" },
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }
]
}
languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
packs: + codeql/javascript-queries
config-file-test: .github/codeql/queries-and-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries from input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }]
}
languages: javascript
queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Multi-language packs from config
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": {
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ],
"ruby": ["codeql/ruby-queries"]
},
"queries": [
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }
]
}
languages: javascript,ruby
config-file-test: .github/codeql/multi-language-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries from input with +
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }]
}
languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Other config properties
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"name": "Config using all properties",
"packs": ["codeql/javascript-queries" ],
"disable-default-queries": true,
"paths-ignore": ["xxx"],
"paths": ["yyy"]
}
languages: javascript
packs: + codeql/javascript-queries
config-file-test: .github/codeql/other-config-properties.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from input with +
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }],
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from config
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }],
"packs": {
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
}
languages: javascript
config-file-test: .github/codeql/queries-and-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from config overriden by input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }],
"packs": ["codeql/javascript-queries"]
}
languages: javascript
queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
packs: codeql/javascript-queries
config-file-test: .github/codeql/queries-and-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from config merging with input
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": {
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2", "codeql/javascript-queries" ]
},
"queries": [
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" },
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }
]
}
languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
packs: + codeql/javascript-queries
config-file-test: .github/codeql/queries-and-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Multi-language packs from config
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": {
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ],
"ruby": ["codeql/ruby-queries"]
},
"queries": [
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }
]
}
languages: javascript,ruby
config-file-test: .github/codeql/multi-language-packs-config.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Other config properties
if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"name": "Config using all properties",
"packs": ["codeql/javascript-queries" ],
"disable-default-queries": true,
"paths-ignore": ["xxx"],
"paths": ["yyy"]
}
languages: javascript
packs: + codeql/javascript-queries
config-file-test: .github/codeql/other-config-properties.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -64,7 +64,7 @@ jobs:
npm ci
- name: Verify compiled JS up to date
run: .github/workflows/script/check-js.sh
run: npx tsx pr-checks/check-unchanged.ts --language javascript
- name: Run unit tests
if: always()
@@ -122,6 +122,9 @@ jobs:
id: install-deps
run: npm ci
- name: Verify YAML is correctly formatted
run: npx tsx pr-checks/check-unchanged.ts --language yaml
- name: Verify PR checks up to date
if: ${{ !cancelled() && steps.install-deps.outcome == 'success' }}
run: .github/workflows/script/verify-pr-checks.sh

View File

@@ -1,10 +1,10 @@
name: 'Publish Immutable Action Version'
name: "Publish Immutable Action Version"
on:
push:
tags:
# Match version tags, but not the major version tags.
- 'v[0-9]+.**'
- "v[0-9]+.**"
defaults:
run:

View File

@@ -8,7 +8,7 @@ on:
types: [checks_requested]
schedule:
# Weekly on Monday.
- cron: '0 0 * * 1'
- cron: "0 0 * * 1"
workflow_dispatch:
concurrency:
@@ -32,22 +32,22 @@ jobs:
runs-on: windows-2025
steps:
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: 3.12
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: 3.12
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare test
uses: ./.github/actions/prepare-test
with:
version: default
- name: Prepare test
uses: ./.github/actions/prepare-test
with:
version: default
- name: Initialize CodeQL
uses: ./../action/init
with:
tools: linked
languages: python
- name: Initialize CodeQL
uses: ./../action/init
with:
tools: linked
languages: python
- name: Analyze
uses: ./../action/analyze
- name: Analyze
uses: ./../action/analyze

View File

@@ -3,13 +3,13 @@ name: Query filters tests
on:
push:
branches:
- main
- releases/v*
- main
- releases/v*
pull_request:
merge_group:
types: [checks_requested]
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
concurrency:
@@ -29,47 +29,47 @@ jobs:
permissions:
contents: read # This permission is needed to allow the GitHub Actions workflow to read the contents of the repository.
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- name: Install Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm ci
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: linked
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: linked
- name: Check SARIF for default queries with Single include, Single exclude
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip
queries-not-run: js/path-injection
config-file: ./.github/codeql/codeql-config-query-filters1.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check SARIF for default queries with Single include, Single exclude
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip
queries-not-run: js/path-injection
config-file: ./.github/codeql/codeql-config-query-filters1.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check SARIF for query packs with Single include, Single exclude
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip,javascript/example/empty-or-one-block
queries-not-run: js/path-injection
config-file: ./.github/codeql/codeql-config-query-filters2.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check SARIF for query packs with Single include, Single exclude
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip,javascript/example/empty-or-one-block
queries-not-run: js/path-injection
config-file: ./.github/codeql/codeql-config-query-filters2.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check SARIF for query packs and local queries with Single include, Single exclude
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip,javascript/example/empty-or-one-block,inrepo-javascript-querypack/show-ifs
queries-not-run: js/path-injection,complex-python-querypack/show-ifs,complex-python-querypack/foo/bar/show-ifs
config-file: ./.github/codeql/codeql-config-query-filters3.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check SARIF for query packs and local queries with Single include, Single exclude
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip,javascript/example/empty-or-one-block,inrepo-javascript-querypack/show-ifs
queries-not-run: js/path-injection,complex-python-querypack/show-ifs,complex-python-querypack/foo/bar/show-ifs
config-file: ./.github/codeql/codeql-config-query-filters3.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -1,33 +0,0 @@
#!/bin/bash
set -eu
# Sanity check that repo is clean to start with
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then this workflow needs attention...
>&2 echo "Failed: Repo should be clean before testing!"
exit 1
fi
# Wipe the lib directory in case there are extra unnecessary files in there
rm -rf lib
# Generate the JavaScript files
npm run-script build
# Check that repo is still clean
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then the PR needs attention
>&2 echo "Failed: JavaScript files are not up to date. Run 'rm -rf lib && npm run-script build' to update"
git status
echo "### Transpiled JS diff" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git diff --output="$RUNNER_TEMP/js.diff"
cat "$RUNNER_TEMP/js.diff" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# Reset bundled files to allow other checks to test for changes
git checkout lib
# Fail this check
exit 1
fi
echo "Success: JavaScript files are up to date"

View File

@@ -1,17 +1,17 @@
name: 'PR Check - CodeQL Bundle All'
name: "PR Check - CodeQL Bundle All"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
- main
- releases/v*
pull_request:
merge_group:
types: [checks_requested]
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:
concurrency:
@@ -27,9 +27,9 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-26.04
version: nightly-latest
name: 'CodeQL Bundle All'
- os: ubuntu-26.04
version: nightly-latest
name: "CodeQL Bundle All"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -37,26 +37,26 @@ jobs:
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: true
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: '9.x'
- id: init
uses: ./../action/init
with:
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: true
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: "9.x"
- id: init
uses: ./../action/init
with:
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -30,7 +30,7 @@ jobs:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: '${{ toJson(github) }}'
GITHUB_CONTEXT: "${{ toJson(github) }}"
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -44,7 +44,7 @@ jobs:
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'npm'
cache: "npm"
- name: Install dependencies
run: npm ci
@@ -113,11 +113,12 @@ jobs:
echo "CLI_VERSION=$cli_version" | tee -a "$GITHUB_ENV"
echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV"
- name: Create changelog note
- name: Create changenote
run: |
npx tsx pr-checks/bundle-changelog.ts
- name: Push changelog note
- name: Push changenote
run: |
git commit -am "Add changelog note"
git add unreleased-change-notes
git commit -m "Add changenote"
git push

View File

@@ -38,43 +38,43 @@ jobs:
contents: write # needed to push commits
pull-requests: write # needed to create pull request
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # Need full history for calculation of diffs
- uses: ./.github/actions/release-initialise
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # Need full history for calculation of diffs
- uses: ./.github/actions/release-initialise
# when the workflow has been manually triggered on main,
# we know that we definitely want the release branch to exist
- name: Ensure release branch exists
run: |
echo "MAJOR_VERSION ${MAJOR_VERSION}"
RELEASE_BRANCH=releases/${MAJOR_VERSION}
if git checkout $RELEASE_BRANCH > /dev/null 2>&1; then
echo "Branch $RELEASE_BRANCH already exists"
echo ""
else
echo "Creating $RELEASE_BRANCH branch"
git checkout -b ${RELEASE_BRANCH} ${LATEST_TAG}
git push --set-upstream origin ${RELEASE_BRANCH}
git branch --show-current
echo ""
fi
echo "Returning to branch: ${REF_NAME}"
git checkout ${REF_NAME}
# when the workflow has been manually triggered on main,
# we know that we definitely want the release branch to exist
- name: Ensure release branch exists
run: |
echo "MAJOR_VERSION ${MAJOR_VERSION}"
RELEASE_BRANCH=releases/${MAJOR_VERSION}
if git checkout $RELEASE_BRANCH > /dev/null 2>&1; then
echo "Branch $RELEASE_BRANCH already exists"
echo ""
else
echo "Creating $RELEASE_BRANCH branch"
git checkout -b ${RELEASE_BRANCH} ${LATEST_TAG}
git push --set-upstream origin ${RELEASE_BRANCH}
git branch --show-current
echo ""
fi
echo "Returning to branch: ${REF_NAME}"
git checkout ${REF_NAME}
- name: Update current release branch
if: github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo SOURCE_BRANCH=${REF_NAME}
echo TARGET_BRANCH=releases/${MAJOR_VERSION}
npx tsx ./pr-checks/update-release-branch.ts \
--repository-nwo ${{ github.repository }} \
--source-branch '${{ env.REF_NAME }}' \
--target-branch 'releases/${{ env.MAJOR_VERSION }}' \
--is-primary-release \
--conductor ${GITHUB_ACTOR}
- name: Update current release branch
if: github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo SOURCE_BRANCH=${REF_NAME}
echo TARGET_BRANCH=releases/${MAJOR_VERSION}
npx tsx ./pr-checks/update-release-branch.ts \
--repository-nwo ${{ github.repository }} \
--source-branch '${{ env.REF_NAME }}' \
--target-branch 'releases/${{ env.MAJOR_VERSION }}' \
--is-primary-release \
--conductor ${GITHUB_ACTOR}
backport:
name: "Create backport"
@@ -94,28 +94,28 @@ jobs:
contents: write # needed to push commits
pull-requests: write # needed to create pull request
steps:
- name: Generate token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
- name: Generate token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # Need full history for calculation of diffs
token: ${{ steps.app-token.outputs.token }}
- uses: ./.github/actions/release-initialise
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # Need full history for calculation of diffs
token: ${{ steps.app-token.outputs.token }}
- uses: ./.github/actions/release-initialise
- name: Update older release branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo SOURCE_BRANCH=${SOURCE_BRANCH}
echo TARGET_BRANCH=${TARGET_BRANCH}
npx tsx ./pr-checks/update-release-branch.ts \
--repository-nwo ${{ github.repository }} \
--source-branch ${SOURCE_BRANCH} \
--target-branch ${TARGET_BRANCH} \
--conductor ${GITHUB_ACTOR}
- name: Update older release branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo SOURCE_BRANCH=${SOURCE_BRANCH}
echo TARGET_BRANCH=${TARGET_BRANCH}
npx tsx ./pr-checks/update-release-branch.ts \
--repository-nwo ${{ github.repository }} \
--source-branch ${SOURCE_BRANCH} \
--target-branch ${TARGET_BRANCH} \
--conductor ${GITHUB_ACTOR}

View File

@@ -29,7 +29,7 @@ jobs:
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'npm'
cache: "npm"
- name: Install dependencies
run: npm ci

View File

@@ -15,7 +15,7 @@
"search.exclude": {
"**/node_modules": true,
"build": true,
"lib": true,
"lib": true
},
// Installing a new Node package often triggers VS Code's git limit warnings as there is typically
// an intermediate stage where many files are modified. This setting suppresses these warnings.
@@ -26,4 +26,9 @@
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.prettierPath": "./node_modules/prettier"
}

View File

@@ -2,6 +2,14 @@
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
## [UNRELEASED]
No user facing changes.
## 4.39.3 - 04 Nov 2026
- Fixed diff-informed alert filtering incorrectly removing alerts in changed files whose paths contain spaces, special characters, or non-ASCII characters. [#4283](https://github.com/github/codeql-action/pull/4283)
## 4.39.2 - 03 Nov 2026
- Update default CodeQL bundle version to [2.27.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.4). [#4284](https://github.com/github/codeql-action/pull/4284)

View File

@@ -1,10 +1,10 @@
name: 'CodeQL: Stub'
name: "CodeQL: Stub"
description: "Stub: Don't use this action directly. Read [the documentation](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql) instead."
author: 'GitHub'
author: "GitHub"
runs:
using: 'composite'
using: "composite"
steps:
- name: 'Stub'
- name: "Stub"
run: |
echo 'This is a stub. Read [the documentation](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql) instead.'
exit 1

View File

@@ -1,6 +1,6 @@
name: 'CodeQL: Autobuild'
description: 'Attempt to automatically build the code. Only used for analyzing languages that require a build. Use the `build-mode: autobuild` input in the `init` action instead.'
author: 'GitHub'
name: "CodeQL: Autobuild"
description: "Attempt to automatically build the code. Only used for analyzing languages that require a build. Use the `build-mode: autobuild` input in the `init` action instead."
author: "GitHub"
inputs:
token:
description: "GitHub token to use for authenticating with this instance of GitHub. The token needs the `security-events: write` permission."
@@ -16,4 +16,4 @@ inputs:
required: false
runs:
using: node24
main: '../lib/autobuild-entry.js'
main: "../lib/autobuild-entry.js"

View File

@@ -1,6 +1,6 @@
name: 'CodeQL: Init'
description: 'Set up CodeQL'
author: 'GitHub'
name: "CodeQL: Init"
description: "Set up CodeQL"
author: "GitHub"
inputs:
tools:
description: >-
@@ -56,7 +56,7 @@ inputs:
- `code-scanning`: The default, security-focused analysis.
- `code-quality`: Analysis focused on code quality. This must be enabled in conjunction
with `code-scanning`.
default: 'code-scanning'
default: "code-scanning"
required: true
token:
description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use the registries input.
@@ -100,7 +100,7 @@ inputs:
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
required: false
quality-queries:
description: '[Internal] DEPRECATED. Comma-separated list of code quality queries to run.'
description: "[Internal] DEPRECATED. Comma-separated list of code quality queries to run."
required: false
packs:
description: >-
@@ -140,7 +140,7 @@ inputs:
This will result in more output being produced which may be useful when debugging certain issues.
Debugging mode is enabled automatically when step debug logging is turned on.
required: false
default: 'false'
default: "false"
debug-artifact-name:
description: >-
The name of the artifact to store debugging information in.
@@ -181,5 +181,5 @@ outputs:
description: The version of the CodeQL binary used for analysis
runs:
using: node24
main: '../lib/init-entry.js'
post: '../lib/init-post-entry.js'
main: "../lib/init-entry.js"
post: "../lib/init-post-entry.js"

4010
lib/entry-points.js generated

File diff suppressed because it is too large Load Diff

75
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "codeql",
"version": "4.39.2",
"version": "4.39.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "codeql",
"version": "4.39.2",
"version": "4.39.4",
"license": "MIT",
"workspaces": [
"pr-checks"
@@ -33,7 +33,7 @@
"js-yaml": "^5.5.0",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.0",
"node-forge": "^1.4.1",
"semver": "^7.8.5",
"undici": "^7.30.1",
"uuid": "^14.0.3"
@@ -59,9 +59,10 @@
"eslint-plugin-import-x": "^4.17.1",
"eslint-plugin-jsdoc": "^65.4.0",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^13.0.6",
"glob": "^14.0.3",
"globals": "^17.13.0",
"nock": "^14.0.17",
"prettier": "^3.9.10",
"sinon": "^22.1.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.72.0"
@@ -1810,6 +1811,12 @@
"node": ">=18.0.0"
}
},
"node_modules/@isaacs/nonrecursive-glob-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.2.tgz",
"integrity": "sha512-GJPHIgPPtFl+nLhFHyF0zZoFcOFLsZWbHFFzo+Zr+PWDXJbl9hHxb2w+9SiF2fHmLgKaXIpUzQo3SbBBZ9WObw==",
"license": "BlueOak-1.0.0"
},
"node_modules/@mapbox/node-pre-gyp": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.3.tgz",
@@ -3523,7 +3530,6 @@
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
@@ -3533,7 +3539,6 @@
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
@@ -4438,7 +4443,6 @@
},
"node_modules/color-convert": {
"version": "2.0.1",
"dev": true,
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
@@ -4449,7 +4453,6 @@
},
"node_modules/color-name": {
"version": "1.1.4",
"dev": true,
"license": "MIT"
},
"node_modules/comment-parser": {
@@ -4574,7 +4577,6 @@
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
@@ -4829,7 +4831,6 @@
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"dev": true,
"license": "MIT"
},
"node_modules/es-abstract": {
@@ -6272,14 +6273,14 @@
}
},
"node_modules/glob": {
"version": "13.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
"integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
"version": "14.0.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.3.tgz",
"integrity": "sha512-A1vjIwC3qpdCso45Iw127gnp7sPhqgY8lUQhDrArIs+GbmfaaVPFuoyy7WyLT9EPZCRZ7j7aLdwUhQmHWesEow==",
"license": "BlueOak-1.0.0",
"dependencies": {
"minimatch": "^10.2.2",
"minimatch": "^11.0.2",
"minipass": "^7.1.3",
"path-scurry": "^2.0.2"
"path-scurry": "^3.0.0"
},
"engines": {
"node": "18 || 20 || >=22"
@@ -6323,12 +6324,13 @@
}
},
"node_modules/glob/node_modules/minimatch": {
"version": "10.2.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
"version": "11.0.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.2.tgz",
"integrity": "sha512-pWTgz5CN3tjqyZNSK2tePlSmu9IwM41q8yn8Usdqqwe9TIHh+9dEpLLjF4uApsfPEAZY71qtSiA2B2APEr+1Yw==",
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.2"
"@isaacs/nonrecursive-glob-match": "^1.0.2",
"brace-expansion": "^5.0.12"
},
"engines": {
"node": "18 || 20 || >=22"
@@ -6857,7 +6859,6 @@
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
@@ -7168,7 +7169,6 @@
},
"node_modules/isexe": {
"version": "2.0.0",
"dev": true,
"license": "ISC"
},
"node_modules/js-string-escape": {
@@ -7478,9 +7478,9 @@
"integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA=="
},
"node_modules/lru-cache": {
"version": "11.5.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz",
"integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==",
"version": "11.5.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
"integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
"license": "BlueOak-1.0.0",
"engines": {
"node": "20 || >=22"
@@ -8198,9 +8198,9 @@
}
},
"node_modules/node-forge": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.1.tgz",
"integrity": "sha512-w5/MfWaeMrpR/5ba6fZyAUTLSuE6aYz7H/3cYrqwZEmf5eQS3IaaLgJt4MBv7HglGFWmV22K8h4U18RJQmw/ow==",
"license": "(BSD-3-Clause OR GPL-2.0)",
"engines": {
"node": ">= 6.13.0"
@@ -8571,7 +8571,6 @@
},
"node_modules/path-key": {
"version": "3.1.1",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
@@ -8583,9 +8582,9 @@
"license": "MIT"
},
"node_modules/path-scurry": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
"integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz",
"integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==",
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^11.0.0",
@@ -8670,9 +8669,9 @@
}
},
"node_modules/prettier": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz",
"integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==",
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz",
"integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==",
"dev": true,
"license": "MIT",
"bin": {
@@ -9171,7 +9170,6 @@
},
"node_modules/shebang-command": {
"version": "2.0.0",
"dev": true,
"license": "MIT",
"dependencies": {
"shebang-regex": "^3.0.0"
@@ -9182,7 +9180,6 @@
},
"node_modules/shebang-regex": {
"version": "3.0.0",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
@@ -9268,7 +9265,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
"engines": {
"node": ">=14"
},
@@ -9455,7 +9451,6 @@
},
"node_modules/string-width": {
"version": "4.2.3",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
@@ -9541,7 +9536,6 @@
},
"node_modules/strip-ansi": {
"version": "6.0.1",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
@@ -10279,7 +10273,6 @@
},
"node_modules/which": {
"version": "2.0.2",
"dev": true,
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
@@ -10569,7 +10562,7 @@
"@octokit/core": "^7.0.8",
"@octokit/plugin-paginate-rest": ">=16.0.0",
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
"glob": "^13.0.6",
"glob": "^14.0.3",
"lite-matter": "^0.1.2",
"mdast-util-from-markdown": "^2.1.0",
"semver": "^7.8.5",

View File

@@ -1,11 +1,12 @@
{
"name": "codeql",
"version": "4.39.2",
"version": "4.39.4",
"private": true,
"description": "CodeQL action",
"scripts": {
"_build_comment": "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'",
"build": "./scripts/check-node-modules.sh && npm run transpile && node build.mjs",
"format-yaml": "prettier --write --parser yaml '**/*.{yml,yaml}'",
"lint": "eslint --report-unused-disable-directives --max-warnings=0 .",
"lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif",
"lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix",
@@ -42,7 +43,7 @@
"js-yaml": "^5.5.0",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.0",
"node-forge": "^1.4.1",
"semver": "^7.8.5",
"undici": "^7.30.1",
"uuid": "^14.0.3"
@@ -68,9 +69,10 @@
"eslint-plugin-import-x": "^4.17.1",
"eslint-plugin-jsdoc": "^65.4.0",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^13.0.6",
"glob": "^14.0.3",
"globals": "^17.13.0",
"nock": "^14.0.17",
"prettier": "^3.9.10",
"sinon": "^22.1.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.72.0"
@@ -94,7 +96,7 @@
"eslint-plugin-jsx-a11y": {
"semver": ">=6.3.1"
},
"glob": "^13.0.6",
"glob": "^14.0.3",
"undici": "^7.30.1"
}
}

View File

@@ -10,17 +10,13 @@ import { afterEach, beforeEach, describe, it } from "node:test";
import {
CLI_VERSION_ENV_VAR,
getChangenote,
getCLIVersion,
getPRNumber,
getPRUrl,
PR_URL_ENV_VAR,
updateChangelog,
} from "./bundle-changelog";
import {
EMPTY_CHANGELOG,
NO_CHANGES_STR,
UNRELEASED_PLACEHOLDER,
} from "./changelog";
import { isValidChangenoteContent } from "./changelog/validate";
let testDir: string;
@@ -85,58 +81,15 @@ describe("getPRNumber", async () => {
});
});
const testChangelog = `${EMPTY_CHANGELOG.trimEnd()}
## 4.23.7
- Other change
## 4.23.6
${NO_CHANGES_STR}`;
const expectedChangelog = `# CodeQL Action Changelog
## ${UNRELEASED_PLACEHOLDER}
- Update default CodeQL bundle version to
## 4.23.7
- Other change
## 4.23.6
${NO_CHANGES_STR}`;
describe("updateChangelog", async () => {
await it("removes `NO_CHANGES_STR` if present in [UNRELEASED] section", async () => {
const result = updateChangelog(EMPTY_CHANGELOG, "");
assert.ok(!result.includes(NO_CHANGES_STR));
});
await it("doesn't remove `NO_CHANGES_STR` if present in versioned section", async () => {
const result = updateChangelog(
EMPTY_CHANGELOG.replace(UNRELEASED_PLACEHOLDER, "1.2.3"),
"",
describe("getChangenote", async () => {
await it("returns a note linking to the bundle release and the PR", async () => {
assert.equal(
getChangenote("1.2.3", testPrUrl),
"- Update default CodeQL bundle version to [1.2.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v1.2.3). [#42](https://github.com/github/codeql-action/pulls/42)\n",
);
assert.ok(result.includes(NO_CHANGES_STR));
});
await it("throws if there are no sections", async () => {
assert.throws(() => {
updateChangelog(
"# CodeQL Action Changelog",
"- Update default CodeQL bundle version to",
);
});
});
await it("adds note at the end of the first section", async () => {
const result = updateChangelog(
testChangelog,
"- Update default CodeQL bundle version to",
);
assert.deepEqual(result, expectedChangelog);
await it("returns valid changenote content", async () => {
assert.ok(isValidChangenoteContent(getChangenote("1.2.3", testPrUrl)));
});
});

View File

@@ -1,17 +1,13 @@
#!/usr/bin/env npx tsx
/**
* Updates the changelog with a change note for an updated CodeQL CLI bundle.
* Creates a changenote file for an update to the default CodeQL CLI bundle.
*/
import * as fs from "node:fs";
import * as path from "node:path";
import {
parseChangelog,
renderChangelog,
UNRELEASED_PLACEHOLDER,
} from "./changelog";
import { CHANGELOG_FILE, CLI_BUNDLE_RELEASE_URL_PREFIX } from "./config";
import { CHANGENOTES_DIR, CLI_BUNDLE_RELEASE_URL_PREFIX } from "./config";
import { getErrorMessage } from "./util";
export const CLI_VERSION_ENV_VAR = "CLI_VERSION";
@@ -58,42 +54,19 @@ export function getPRNumber(prUrl: string) {
}
/**
* Updates `changelog` by adding `changelogNote` to the first section.
* Returns the contents of the changenote file for an update to the default
* CodeQL CLI bundle.
*
* @param contents The existing changelog contents.
* @param changelogNote The note to add to the first section.
* @param cliVersion The CodeQL CLI version of the new default bundle.
* @param prUrl The URL of the PR that updates the default bundle.
* @throws If the PR number can't be determined from `prUrl`.
*/
export function updateChangelog(contents: string, changelogNote: string) {
// If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
contents = contents.replace(
`## ${UNRELEASED_PLACEHOLDER}\n\nNo user facing changes.`,
`## ${UNRELEASED_PLACEHOLDER}\n`,
);
export function getChangenote(cliVersion: string, prUrl: string): string {
// The GitHub Release for the new bundle version.
const bundleReleaseUrl = `${CLI_BUNDLE_RELEASE_URL_PREFIX}${cliVersion}`;
const changelog = parseChangelog(contents);
if (changelog.sections.length === 0) {
throw new Error("The changelog contains no existing sections.");
}
// Add the changelog note to the bottom of the first section.
const firstSection = changelog.sections[0];
const lastLine = firstSection.bodyLines.pop();
if (lastLine !== undefined && lastLine.trim() !== "") {
// We expect the last line to be empty. If it isn't for some reason,
// add it back.
firstSection.bodyLines.push(lastLine);
}
firstSection.bodyLines.push(changelogNote);
// If the last line is empty as expected, then add it back in after the new note.
if (lastLine?.trim() === "") {
firstSection.bodyLines.push(lastLine);
}
return renderChangelog(changelog);
const prNumber = getPRNumber(prUrl);
return `- Update default CodeQL bundle version to [${cliVersion}](${bundleReleaseUrl}). [#${prNumber}](${prUrl})\n`;
}
function main() {
@@ -101,22 +74,19 @@ function main() {
const cliVersion = getCLIVersion();
const prUrl = getPRUrl();
// The GitHub Release for the new bundle version.
const bundleReleaseUrl = `${CLI_BUNDLE_RELEASE_URL_PREFIX}${cliVersion}`;
// Get the PR number from the PR URL.
const prNumber = getPRNumber(prUrl);
const changelogNote = `- Update default CodeQL bundle version to [${cliVersion}](${bundleReleaseUrl}). [#${prNumber}](${prUrl})`;
let changelog = fs.readFileSync(CHANGELOG_FILE, "utf-8");
changelog = updateChangelog(changelog, changelogNote);
fs.writeFileSync(CHANGELOG_FILE, changelog);
// Include the CLI version in the file name so that changenotes for
// different bundle updates don't conflict.
const changenotePath = path.join(
CHANGENOTES_DIR,
`update-bundle-${cliVersion}.md`,
);
fs.writeFileSync(changenotePath, getChangenote(cliVersion, prUrl));
return 0;
} catch (err) {
console.error(`Failed to bundle changelog: ${getErrorMessage(err)}`);
console.error(
`Failed to create changenote for bundle update: ${getErrorMessage(err)}`,
);
return -1;
}
}

153
pr-checks/check-unchanged.ts Executable file
View File

@@ -0,0 +1,153 @@
#!/usr/bin/env npx tsx
import * as fs from "node:fs";
import * as path from "node:path";
import { parseArgs } from "node:util";
import * as core from "@actions/core";
import { runCommand, runGit } from "./command";
import { LIB_ROOT, PR_CHECKS_DIR, REPO_ROOT } from "./config";
import { getErrorMessage } from "./util";
/**
* Checks whether the repo is clean by running `git status --porcelain`.
* If the repository is not clean, the changes are printed to stdout.
*
* @returns `true` if the repo is clean or `false` otherwise.
*/
function isRepoClean(): boolean {
const stdout = runGit(["status", "--porcelain"]);
if (stdout === "") {
return true;
}
console.log(stdout);
return false;
}
/**
* Checks whether the repository is clean to begin with, then runs {@link body}, and finally
* checks if the repository is still clean.
*
* @param body The function to run.
* @returns `true` if the repo is clean or `false` otherwise.
*/
function checkUnchanged(body: () => void): boolean {
// Sanity check that repo is clean to start with
if (isRepoClean()) {
console.info("Repository is clean.");
} else {
// If we get a fail here then this workflow needs attention...
console.error("The repository contains uncomitted changes!");
return false;
}
body();
// Check that repo is still clean
const result = isRepoClean();
if (result) {
console.info("Repository is still clean.");
} else {
console.info("Repository is now dirty.");
}
return result;
}
/**
* Produces a full diff for the repository and adds it to the workflow job summary
* under the {@link summaryHeader} header.
*/
async function addDiffToSummary(summaryHeader: string) {
const diffFile = path.join(
process.env["RUNNER_TEMP"] ?? PR_CHECKS_DIR,
"summary.diff",
);
try {
runCommand("git", ["status"]);
runCommand("git", ["diff", `--output=${diffFile}`], {
execOptions: { cwd: REPO_ROOT },
});
core.summary.addHeading(summaryHeader, 3);
core.summary.addCodeBlock(fs.readFileSync(diffFile, "utf-8"), "diff");
await core.summary.write();
try {
fs.rmSync(diffFile);
} catch (err) {
console.warn(
`Failed to remove temporary diff file from '${diffFile}': ${getErrorMessage(err)}`,
);
}
} catch (err) {
console.error(
`Failed to add full diff to summary for '${summaryHeader}': ${getErrorMessage(err)}`,
);
}
}
/**
* Rebuilds the JavaScript by cleaning up and running `npm run build`.
*/
function rebuildJavaScript() {
// Wipe the lib directory in case there are extra unnecessary files in there
console.info(`Removing ${LIB_ROOT}...`);
fs.rmSync(LIB_ROOT, { recursive: true, force: true });
// Generate the JavaScript files
runCommand("npm", ["run", "build"], { execOptions: { shell: true } });
}
/**
* Formats YAML files with `npm run format-yaml`.
*/
function formatYAML() {
runCommand("npm", ["run", "format-yaml"], { execOptions: { shell: true } });
}
async function main() {
const { values: options } = parseArgs({
options: { language: { type: "string", default: "javascript" } },
});
console.info(`Checking that ${options.language} files are unchanged.`);
if (options.language === "javascript") {
if (!checkUnchanged(rebuildJavaScript)) {
// If we get a fail here then the PR needs attention
console.error("Failed: JavaScript files are not up to date.");
console.error("Run 'rm -rf lib && npm run build' to update.");
await addDiffToSummary("Transpiled JS diff");
// Reset bundled files to allow other checks to test for changes
runCommand("git", ["checkout", "lib"]);
return 1;
}
console.info("Success: JavaScript files are up to date");
} else if (options.language === "yaml") {
if (!checkUnchanged(formatYAML)) {
// If we get a fail here then the PR needs attention
console.error("Failed: YAML files are not correctly formatted.");
console.error("Run 'npm run format-yaml' to format them.");
await addDiffToSummary("YAML formatting changes");
return 1;
}
console.info("Success: YAML files are correctly formatted");
} else {
console.error(`Unknown language: ${options.language}`);
return 1;
}
return 0;
}
process.exit(await main());

View File

@@ -14,5 +14,5 @@ steps:
run: ./build.sh
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"

View File

@@ -23,9 +23,9 @@ steps:
config-file: ./.github/codeql/codeql-config-registries.yml
languages: javascript
registries: |
- url: "https://ghcr.io/v2/"
packages: "*/*"
token: "${{ secrets.GITHUB_TOKEN }}"
- url: "https://ghcr.io/v2/"
packages: "*/*"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Verify packages installed
run: |

View File

@@ -6,7 +6,7 @@ versions:
steps:
- uses: ./../action/init
with:
languages: actions # Any language without overlay support will do
languages: actions # Any language without overlay support will do
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
CODEQL_OVERLAY_DATABASE_MODE: overlay-base

View File

@@ -48,7 +48,7 @@ validationJobs:
installNode: true
steps:
- name: Download workflow artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: test-mode-sarif-*
path: sarif

View File

@@ -15,10 +15,10 @@ steps:
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
upload: never
- uses: ./../action/upload-sarif
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"

View File

@@ -19,8 +19,8 @@ steps:
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
upload: never
output: ${{ runner.temp }}/results
@@ -29,8 +29,8 @@ steps:
uses: ./../action/upload-sarif
id: upload-sarif
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:all-files/
@@ -46,8 +46,8 @@ steps:
id: upload-single-sarif-code-scanning
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results/javascript.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-scanning/
@@ -59,8 +59,8 @@ steps:
id: upload-single-sarif-code-quality
if: contains(matrix.analysis-kinds, 'code-quality')
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results/javascript.quality.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-quality/
@@ -76,8 +76,8 @@ steps:
id: upload-single-non-sarif
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
ref: "refs/heads/main"
sha: "5e235361806c361d4d3f8859e3c897658025a9a2"
sarif_file: ${{ runner.temp }}/results/javascript.sarif.json
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:non-sarif/

81
pr-checks/command.ts Normal file
View File

@@ -0,0 +1,81 @@
import { execFileSync, ExecFileSyncOptions } from "node:child_process";
import { DryRunOption, REPO_ROOT } from "./config";
/** Options for {@link runCommand}. */
export interface RunCommandOptions extends DryRunOption {
/** Options for `execFileSync`. */
execOptions?: ExecFileSyncOptions;
}
/**
* Runs a command, streaming output to the console by default.
*
* @param command The name of the command to run.
* @param args The arguments for the command.
* @throws When the process exits with a non-zero exit code.
* @param options How to run the command.
*/
export function runCommand(
command: string,
args: string[],
options?: RunCommandOptions,
) {
if (!options?.dryRun) {
console.log(`Running \`${command} ${args.join(" ")}\`.`);
return execFileSync(command, args, {
stdio: "inherit",
cwd: REPO_ROOT,
...options?.execOptions,
});
} else {
console.info(
`[DRY RUN] Would have executed '${command} ${args.join(" ")}'`,
);
return "";
}
}
/** Options for {@link runGit}. */
export interface RunGitOptions extends DryRunOption {
/** When true, non-zero exit codes will not throw. */
allowNonZeroExitCode?: boolean;
}
/**
* Runs `git` with the given `args` and returns the stdout.
*
* @param args - Arguments to pass to `git`.
* @param options - Optional settings.
* @throws If `git` does not exit successfully, unless
* `options.allowNonZeroExitCode` is `true`.
* @returns The trimmed stdout output.
*/
export function runGit(args: string[], options?: RunGitOptions): string {
const execOptions: ExecFileSyncOptions = {
encoding: "utf8",
stdio: ["pipe", "pipe", "pipe"],
};
try {
const result = runCommand("git", args, {
dryRun: options?.dryRun,
execOptions,
}) as string;
return result.trimEnd();
} catch (error: unknown) {
if (options?.allowNonZeroExitCode) {
// execFileSync throws an object with `stdout` when the process exits
// with a non-zero code.
const execError = error as { stdout?: Buffer | string };
if (typeof execError.stdout === "string") {
return execError.stdout.trimEnd();
}
if (Buffer.isBuffer(execError.stdout)) {
return execError.stdout.toString("utf8").trimEnd();
}
return "";
}
throw error;
}
}

View File

@@ -30,7 +30,13 @@ export const CHANGENOTES_DIR = path.join(REPO_ROOT, "unreleased-change-notes");
export const BUNDLE_METADATA_FILE = path.join(REPO_ROOT, "meta.json");
/** The `src` directory. */
const SOURCE_ROOT = path.join(REPO_ROOT, "src");
export const SOURCE_ROOT = path.join(REPO_ROOT, "src");
/** The `lib` directory. */
export const LIB_ROOT = path.join(REPO_ROOT, "lib");
/** The path to `defaults.json`. */
export const DEFAULTS_FILE = path.join(SOURCE_ROOT, "defaults.json");
/** The path to the built-in languages file. */
export const BUILTIN_LANGUAGES_FILE = path.join(

View File

@@ -14,7 +14,7 @@
"@octokit/core": "^7.0.8",
"@octokit/plugin-paginate-rest": ">=16.0.0",
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
"glob": "^13.0.6",
"glob": "^14.0.3",
"lite-matter": "^0.1.2",
"mdast-util-from-markdown": "^2.1.0",
"semver": "^7.8.5",

View File

@@ -56,9 +56,18 @@ jobs:
const result = scanGeneratedWorkflows(workflowDir);
assert.equal(result["actions/checkout"], "v4");
assert.equal(result["actions/setup-node"], "v5");
assert.equal(result["actions/setup-go"], "v6");
assert.deepEqual(
result.actionVersions["actions/checkout"],
new Set(["v4"]),
);
assert.deepEqual(
result.actionVersions["actions/setup-node"],
new Set(["v5"]),
);
assert.deepEqual(
result.actionVersions["actions/setup-go"],
new Set(["v6"]),
);
});
await it("scanning workflows with version comments", () => {
@@ -78,12 +87,18 @@ jobs:
const result = scanGeneratedWorkflows(workflowDir);
assert.equal(result["actions/checkout"], "v4");
assert.equal(
result["ruby/setup-ruby"],
"44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
assert.deepEqual(
result.actionVersions["actions/checkout"],
new Set(["v4"]),
);
assert.deepEqual(
result.actionVersions["ruby/setup-ruby"],
new Set(["44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0"]),
);
assert.deepEqual(
result.actionVersions["actions/setup-python"],
new Set(["v6 # Latest Python"]),
);
assert.equal(result["actions/setup-python"], "v6 # Latest Python");
});
await it("ignores local actions", () => {
@@ -103,9 +118,15 @@ jobs:
const result = scanGeneratedWorkflows(workflowDir);
assert.equal(result["actions/checkout"], "v4");
assert.equal("./.github/actions/local-action" in result, false);
assert.equal("./another-local-action" in result, false);
assert.deepEqual(
result.actionVersions["actions/checkout"],
new Set(["v4"]),
);
assert.equal(
"./.github/actions/local-action" in result.actionVersions,
false,
);
assert.equal("./another-local-action" in result.actionVersions, false);
});
});
@@ -128,8 +149,8 @@ const steps = [
fs.writeFileSync(syncTsPath, syncTsContent);
const actionVersions = {
"actions/setup-node": "v5",
"actions/setup-go": "v6",
"actions/setup-node": new Set(["v5"]),
"actions/setup-go": new Set(["v6"]),
};
const result = updateSyncTs(syncTsPath, actionVersions);
@@ -155,7 +176,7 @@ const steps = [
fs.writeFileSync(syncTsPath, syncTsContent);
const actionVersions = {
"actions/setup-node": "v5 # Latest version",
"actions/setup-node": new Set(["v5 # Latest version"]),
};
const result = updateSyncTs(syncTsPath, actionVersions);
@@ -182,7 +203,7 @@ const steps = [
fs.writeFileSync(syncTsPath, syncTsContent);
const actionVersions = {
"actions/setup-node": "v5",
"actions/setup-node": new Set(["v5"]),
};
const result = updateSyncTs(syncTsPath, actionVersions);
@@ -206,7 +227,9 @@ const steps = [
fs.writeFileSync(syncTsPath, syncTsContent);
const actionVersions = {
"actions/setup-node": "48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0",
"actions/setup-node": new Set([
"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0",
]),
};
const result = updateSyncTs(syncTsPath, actionVersions);
@@ -244,8 +267,9 @@ steps:
"actions/checkout": "v4",
"actions/setup-node": "v5 # Latest",
};
const byWorkflow = { ["test.yml"]: actionVersions };
const result = updateTemplateFiles(checksDir, actionVersions);
const result = updateTemplateFiles(checksDir, byWorkflow);
assert.equal(result.length, 1);
assert.ok(result.includes(templatePath));
@@ -269,8 +293,9 @@ steps:
const actionVersions = {
"ruby/setup-ruby": "55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
};
const byWorkflow = { ["test.yml"]: actionVersions };
const result = updateTemplateFiles(checksDir, actionVersions);
const result = updateTemplateFiles(checksDir, byWorkflow);
assert.equal(result.length, 1);
const updatedContent = fs.readFileSync(templatePath, "utf8");

View File

@@ -27,16 +27,39 @@ const CHECKS_DIR = path.join(PR_CHECKS_DIR, "checks");
const WORKFLOW_DIR = path.join(REPO_ROOT, ".github", "workflows");
const SYNC_TS_PATH = path.join(PR_CHECKS_DIR, "sync.ts");
/** Type alias for action names. */
type ActionName = string;
/** Type alias for action versions. May include a comment. */
type ActionVersion = string;
/** Mappings of {@link ActionName}s to {@link ActionVersion}s. */
type ActionVersions = Record<ActionName, ActionVersion>;
/** Mappings of workflow names to {@link ActionVersions}. */
type ActionVersionsByWorkflow = Record<string, ActionVersions>;
/** The result of {@link scanGeneratedWorkflows}. */
type ScanWorkflowResult = {
/** A mapping of {@link ActionName}s to all encountered {@link ActionVersion}s. */
actionVersions: Record<ActionName, Set<ActionVersion>>;
/** A mapping of workflow names to {@link ActionVersions}. */
actionVersionsByWorkflow: ActionVersionsByWorkflow;
};
/**
* Scan generated workflow files to extract the latest action versions.
*
* @param workflowDir - Path to .github/workflows directory
* @returns Map from action names to their latest versions (including comments)
*
* @returns A {@link ScanWorkflowResult} object containing information about the extracted action versions.
*/
export function scanGeneratedWorkflows(
workflowDir: string,
): Record<string, string> {
const actionVersions: Record<string, string> = {};
): ScanWorkflowResult {
const actionVersionsByWorkflow: ActionVersionsByWorkflow = {};
const actionVersions: Record<ActionName, Set<ActionVersion>> = {};
const generatedFiles = fs
.readdirSync(workflowDir)
@@ -46,6 +69,10 @@ export function scanGeneratedWorkflows(
for (const filePath of generatedFiles) {
const content = fs.readFileSync(filePath, "utf8");
// Get the basename of the workflow and drop the leading `__` from it.
const workflowName = path.basename(filePath).slice(2);
actionVersionsByWorkflow[workflowName] = {};
// Find all action uses in the file, including potential comments
// This pattern captures: action_name@version_with_possible_comment
const pattern = /uses:\s+([^/\s]+\/[^@\s]+)@([^@\n]+)/g;
@@ -57,13 +84,26 @@ export function scanGeneratedWorkflows(
// Only track non-local actions (those with / but not starting with ./)
if (!actionName.startsWith("./")) {
// Assume that version numbers are consistent (this should be the case on a Dependabot update PR)
actionVersions[actionName] = versionWithComment;
// Record the version of the action for this workflow.
actionVersionsByWorkflow[workflowName][actionName] = versionWithComment;
// Record this version for the action so that we can write it to `sync.ts` if needed.
// Usually we'd expect there to be exactly one version per action across all workflows,
// but sometimes these can go out-of-sync if e.g. a workflow is added in a branch and a
// Dependabot PR is merged in the meantime that changes the version of an action that is
// used in the new workflow. Different versions of the same action across different
// workflows is not fundamentally a problem, but we may need to pick one for `sync.ts`
// so we warn there if we have multiple versions of an action.
if (actionVersions[actionName] === undefined) {
actionVersions[actionName] = new Set([versionWithComment]);
} else if (!actionVersions[actionName].has(versionWithComment)) {
actionVersions[actionName].add(versionWithComment);
}
}
}
}
return actionVersions;
return { actionVersions, actionVersionsByWorkflow };
}
/**
@@ -79,7 +119,7 @@ export function scanGeneratedWorkflows(
*/
export function updateSyncTs(
syncTsPath: string,
actionVersions: Record<string, string>,
actionVersions: Record<ActionName, Set<ActionVersion>>,
): boolean {
if (!fs.existsSync(syncTsPath)) {
throw new Error(`Could not find ${syncTsPath}`);
@@ -89,9 +129,18 @@ export function updateSyncTs(
const originalContent = content;
// Update hardcoded action versions
for (const [actionName, versionWithComment] of Object.entries(
for (const [actionName, versionsWithComments] of Object.entries(
actionVersions,
)) {
// We usually expect `versionsWithComments` to contain one version. If there are multiple,
// we arbitrarily pick one and warn about it.
const versionsWithCommentsArray = Array.from(versionsWithComments);
const versionWithComment = versionsWithCommentsArray[0];
if (versionsWithComments.size > 1) {
console.warn(
`Inconsistent versions for ${actionName}. Arbitrarily picking '${versionWithComment}'. All found: ${versionsWithCommentsArray.join(", ")}`,
);
}
// Split the scanned value into the ref (e.g. a commit SHA) and the optional
// trailing version comment (e.g. `v6.0.3`).
const ref = versionWithComment.includes("#")
@@ -138,12 +187,12 @@ export function updateSyncTs(
* Update action versions in template files in pr-checks/checks/
*
* @param checksDir - Path to pr-checks/checks directory
* @param actionVersions - Map of action names to versions (may include comments)
* @param actionVersionsByWorkflow - Map of workflows to maps of action names to versions (may include comments)
* @returns List of files that were modified
*/
export function updateTemplateFiles(
checksDir: string,
actionVersions: Record<string, string>,
actionVersionsByWorkflow: ActionVersionsByWorkflow,
): string[] {
const modifiedFiles: string[] = [];
@@ -156,6 +205,16 @@ export function updateTemplateFiles(
let content = fs.readFileSync(filePath, "utf8");
const originalContent = content;
const workflowName = path.basename(filePath);
const actionVersions = actionVersionsByWorkflow[workflowName];
if (actionVersions === undefined) {
console.info(
`Found no action versions for workflow template '${filePath}'.`,
);
continue;
}
// Update action versions
for (const [actionName, versionWithComment] of Object.entries(
actionVersions,
@@ -191,12 +250,15 @@ function main(): number {
const verbose = values.verbose ?? false;
console.info("Scanning generated workflows for latest action versions...");
const actionVersions = scanGeneratedWorkflows(WORKFLOW_DIR);
const { actionVersions, actionVersionsByWorkflow } =
scanGeneratedWorkflows(WORKFLOW_DIR);
if (verbose) {
console.info("Found action versions:");
for (const [action, version] of Object.entries(actionVersions)) {
console.info(` ${action}@${version}`);
for (const [action, versions] of Object.entries(actionVersions)) {
for (const version of versions) {
console.info(` ${action}@${version}`);
}
}
}
@@ -215,7 +277,10 @@ function main(): number {
}
// Update template files
const templateModified = updateTemplateFiles(CHECKS_DIR, actionVersions);
const templateModified = updateTemplateFiles(
CHECKS_DIR,
actionVersionsByWorkflow,
);
modifiedFiles.push(...templateModified);
if (modifiedFiles.length > 0) {

View File

@@ -370,7 +370,7 @@ function writeYaml(filePath: string, workflow: any): void {
});
const yamlStr = yaml.stringify(workflowDoc, {
aliasDuplicateObjects: false,
singleQuote: true,
singleQuote: false,
lineWidth: 0,
});
fs.writeFileSync(filePath, stripTrailingWhitespace(header + yamlStr), "utf8");
@@ -595,16 +595,6 @@ function generateJob(
// Extract the sequence of steps from the YAML document to persist as much formatting as possible.
const specSteps = specDocument.get("steps") as yaml.YAMLSeq;
// A handful of workflow specifications use double quotes for values, while we generally use single quotes.
// This replaces double quotes with single quotes for consistency.
yaml.visit(specSteps, {
Scalar(_key, node) {
if (node.type === "QUOTE_DOUBLE") {
node.type = "QUOTE_SINGLE";
}
},
});
// Add the generated steps in front of the ones from the specification.
specSteps.items.unshift(...steps);
@@ -802,7 +792,7 @@ function main(): void {
}
const cron = new yaml.Scalar("0 5 * * *");
cron.type = yaml.Scalar.QUOTE_SINGLE;
cron.type = yaml.Scalar.QUOTE_DOUBLE;
const workflow = {
name: `PR Check - ${checkSpecification.name}`,

View File

@@ -18,18 +18,14 @@
* [--dry-run]
*/
import { execFileSync, type ExecFileSyncOptions } from "node:child_process";
import { execFileSync } from "node:child_process";
import { parseArgs } from "node:util";
import { type ApiClient, getApiClient } from "./api-client";
import * as changelog from "./changelog";
import { transferChangenotesToChangelog } from "./changenotes";
import {
CHANGELOG_FILE,
CHANGENOTES_DIR,
DryRunOption,
REPO_ROOT,
} from "./config";
import { runCommand, runGit } from "./command";
import { CHANGELOG_FILE, CHANGENOTES_DIR } from "./config";
import {
getCurrentVersion,
replaceVersionInPackageJson,
@@ -71,84 +67,6 @@ export function getGitHubToken(): string {
throw new Error("Missing GitHub token. Set GITHUB_TOKEN or GH_TOKEN.");
}
/** Options for {@link runCommand}. */
export interface RunCommandOptions extends DryRunOption {
/** Options for `execFileSync`. */
execOptions?: ExecFileSyncOptions;
}
/**
* Runs a command, streaming output to the console by default.
*
* @param command The name of the command to run.
* @param args The arguments for the command.
* @throws When the process exits with a non-zero exit code.
* @param options How to run the command.
*/
export function runCommand(
command: string,
args: string[],
options?: RunCommandOptions,
) {
if (!options?.dryRun) {
console.log(`Running \`${command} ${args.join(" ")}\`.`);
return execFileSync(command, args, {
stdio: "inherit",
cwd: REPO_ROOT,
...options?.execOptions,
});
} else {
console.info(
`[DRY RUN] Would have executed '${command} ${args.join(" ")}'`,
);
return "";
}
}
/** Options for {@link runGit}. */
export interface RunGitOptions extends DryRunOption {
/** When true, non-zero exit codes will not throw. */
allowNonZeroExitCode?: boolean;
}
/**
* Runs `git` with the given `args` and returns the stdout.
*
* @param args - Arguments to pass to `git`.
* @param options - Optional settings.
* @throws If `git` does not exit successfully, unless
* `options.allowNonZeroExitCode` is `true`.
* @returns The trimmed stdout output.
*/
export function runGit(args: string[], options?: RunGitOptions): string {
const execOptions: ExecFileSyncOptions = {
encoding: "utf8",
stdio: ["pipe", "pipe", "pipe"],
};
try {
const result = runCommand("git", args, {
dryRun: options?.dryRun,
execOptions,
}) as string;
return result.trimEnd();
} catch (error: unknown) {
if (options?.allowNonZeroExitCode) {
// execFileSync throws an object with `stdout` when the process exits
// with a non-zero code.
const execError = error as { stdout?: Buffer | string };
if (typeof execError.stdout === "string") {
return execError.stdout.trimEnd();
}
if (Buffer.isBuffer(execError.stdout)) {
return execError.stdout.toString("utf8").trimEnd();
}
return "";
}
throw error;
}
}
/** Returns true if the given branch exists on the origin remote. */
export function branchExistsOnRemote(branchName: string): boolean {
const result = runGit(["ls-remote", "--heads", ORIGIN, branchName]);

Some files were not shown because too many files have changed in this diff Show More