Compare commits

..

56 Commits

Author SHA1 Message Date
Angela P Wen
8b6a45a6ec Merge pull request #2144 from github/backport-v2.24.2-ece8414c7
Merge releases/v3 into releases/v2
2024-02-15 03:34:09 -08:00
Henry Mercer
2ccdcd5135 Remove duplicate changelog entry 2024-02-15 11:11:50 +00:00
github-actions[bot]
4f50fb3be5 Update checked-in dependencies 2024-02-15 11:10:16 +00:00
Henry Mercer
02022337ac Update version and changelog for v2.24.2 2024-02-15 11:08:37 +00:00
Henry Mercer
3dafabe4d9 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.2-ece8414c7 2024-02-15 11:08:04 +00:00
Henry Mercer
40cd785140 Revert "Update checked-in dependencies"
This reverts commit 05d809f630.
2024-02-15 11:07:08 +00:00
Henry Mercer
10746dd61e Revert "Update version and changelog for v2.24.1"
This reverts commit d8c4c3a4eb.
2024-02-15 11:07:08 +00:00
Dave Bartolomeo
1a077f8f6c Merge pull request #2133 from github/backport-v2.24.1-e675ced7a
Merge releases/v3 into releases/v2
2024-02-13 07:50:23 -08:00
github-actions[bot]
05d809f630 Update checked-in dependencies 2024-02-13 15:32:00 +00:00
Henry Mercer
d8c4c3a4eb Update version and changelog for v2.24.1 2024-02-13 15:28:16 +00:00
Henry Mercer
b301568384 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.1-e675ced7a 2024-02-13 15:28:12 +00:00
Henry Mercer
f5c8be0ac1 Revert "Update checked-in dependencies"
This reverts commit f822fa3067.
2024-02-13 15:23:47 +00:00
Henry Mercer
4504810aa1 Revert "Update version and changelog for v2.24.0"
This reverts commit 3ed798ed18.
2024-02-13 15:23:47 +00:00
Henry Mercer
dc021d495c Merge pull request #2115 from github/backport-v2.24.0-e8893c57a
Merge releases/v3 into releases/v2
2024-02-02 19:23:13 +00:00
github-actions[bot]
f822fa3067 Update checked-in dependencies 2024-02-02 18:37:21 +00:00
github-actions[bot]
3ed798ed18 Update version and changelog for v2.24.0 2024-02-02 18:32:37 +00:00
github-actions[bot]
5b498ba405 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.0-e8893c57a 2024-02-02 18:32:36 +00:00
github-actions[bot]
7dde705407 Revert "Update checked-in dependencies"
This reverts commit c98f2c953c.
2024-02-02 18:32:36 +00:00
github-actions[bot]
c004a3e831 Revert "Update version and changelog for v2.23.2"
This reverts commit 554c990fe8.
2024-02-02 18:32:36 +00:00
Henry Mercer
2f93e4319b Merge pull request #2102 from github/backport-v2.23.2-b7bf0a3ed
Merge releases/v3 into releases/v2
2024-01-26 15:16:55 +00:00
github-actions[bot]
c98f2c953c Update checked-in dependencies 2024-01-26 14:39:53 +00:00
github-actions[bot]
554c990fe8 Update version and changelog for v2.23.2 2024-01-26 14:35:10 +00:00
github-actions[bot]
abe5934e80 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.23.2-b7bf0a3ed 2024-01-26 14:35:04 +00:00
github-actions[bot]
8879ae88d9 Revert "Update checked-in dependencies"
This reverts commit 554005d264.
2024-01-26 14:35:04 +00:00
github-actions[bot]
01e8d7f881 Revert "Update version and changelog for v2.23.1"
This reverts commit fb29452d38.
2024-01-26 14:35:04 +00:00
Henry Mercer
4759df8df7 Merge pull request #2091 from github/backport-v2.23.1-0b21cf249
Merge releases/v3 into releases/v2
2024-01-17 17:39:22 +00:00
github-actions[bot]
554005d264 Update checked-in dependencies 2024-01-17 16:52:17 +00:00
github-actions[bot]
fb29452d38 Update version and changelog for v2.23.1 2024-01-17 16:25:35 +00:00
github-actions[bot]
13884cb7d7 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.23.1-0b21cf249 2024-01-17 16:25:34 +00:00
github-actions[bot]
ac64986f93 Revert "Update checked-in dependencies"
This reverts commit e24bd8fed4.
2024-01-17 16:25:34 +00:00
github-actions[bot]
cdcacf8b4f Revert "Update version and changelog for v2.23.0"
This reverts commit 8f2682add5.
2024-01-17 16:25:34 +00:00
Henry Mercer
8b7fcbfac2 Merge pull request #2069 from github/backport-v2.23.0-e5f05b81d
Merge releases/v3 into releases/v2
2024-01-08 13:43:00 +00:00
github-actions[bot]
e24bd8fed4 Update checked-in dependencies 2024-01-08 13:12:16 +00:00
Henry Mercer
8f2682add5 Update version and changelog for v2.23.0 2024-01-08 13:05:17 +00:00
Henry Mercer
8f5ae1a11a Merge remote-tracking branch 'origin/releases/v3' into backport-v2.23.0-e5f05b81d 2024-01-08 13:04:05 +00:00
Henry Mercer
99d337aef5 Revert "Update checked-in dependencies"
This reverts commit d6286c6fdb.
2024-01-08 13:04:04 +00:00
Henry Mercer
997d889b5d Revert "Update version and changelog for v2.22.12"
This reverts commit 9c74de20cb.
2024-01-08 13:04:04 +00:00
Angela P Wen
1500a13138 Merge pull request #2054 from github/backport-v2.22.12-012739e50
* Bump the npm group with 4 updates

Bumps the npm group with 4 updates: [@octokit/types](https://github.com/octokit/types.ts), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [typescript](https://github.com/Microsoft/TypeScript).


Updates `@octokit/types` from 12.3.0 to 12.4.0
- [Release notes](https://github.com/octokit/types.ts/releases)
- [Commits](https://github.com/octokit/types.ts/compare/v12.3.0...v12.4.0)

Updates `@typescript-eslint/eslint-plugin` from 6.13.2 to 6.14.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.13.2 to 6.14.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/parser)

Updates `typescript` from 5.3.2 to 5.3.3
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.2...v5.3.3)

---
updated-dependencies:
- dependency-name: "@octokit/types"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

* Update changelog and version after v3.22.11

* Update checked-in dependencies

* improve handling of changelog processing for backports

* change version numbers inside processing function as well

* Apply suggestions from code review

Co-authored-by: Henry Mercer <henry.mercer@me.com>

* rename regex for clarity

* preserve trailing whitespace when transforming CHANGELOG

* raise explicit exception if EOF found when looking for changelog sections

* add note on versioning approach to changelog

* Bump the npm group with 2 updates (#2045)

* Bump the npm group with 2 updates

Bumps the npm group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import).


Updates `eslint` from 8.55.0 to 8.56.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0)

Updates `eslint-plugin-import` from 2.29.0 to 2.29.1
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.29.0...v2.29.1)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* clarify comment on versions in the changelog

* clarify comment on versions in the changelog

* Update default bundle to codeql-bundle-v2.15.5

* Add changelog note

* update required checks script to handle release branches

* add note about backporting check changes to v2 branch

* Fix type error

* Typecast `OLDEST_SUPPORTED_MAJOR_VERSION` when defined

* Update changelog for v3.22.12

* Revert "Update version and changelog for v2.22.11"

This reverts commit e763762131.

* Revert "Update checked-in dependencies"

This reverts commit 20d1a9b175.

* Update version and changelog for v2.22.12

* Update checked-in dependencies

* Resolve conflicts in v3->v2.22.12 merge

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Henry Mercer <henry.mercer@me.com>
Co-authored-by: Nick Fyson <nickfyson@github.com>
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>
Co-authored-by: Aditya Sharad <adityasharad@github.com>
2023-12-22 08:39:43 -08:00
Aditya Sharad
0d318c9f1a Resolve conflicts in v3->v2.22.12 merge 2023-12-22 06:58:29 -08:00
github-actions[bot]
d6286c6fdb Update checked-in dependencies 2023-12-22 04:01:00 +00:00
github-actions[bot]
9c74de20cb Update version and changelog for v2.22.12 2023-12-22 00:47:08 +00:00
github-actions[bot]
49a6ae4966 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.22.12-012739e50
# Conflicts:
#	CONTRIBUTING.md
2023-12-22 00:47:04 +00:00
github-actions[bot]
3366e3bbdd Revert "Update checked-in dependencies"
This reverts commit 20d1a9b175.
2023-12-22 00:47:03 +00:00
github-actions[bot]
844fc3cd56 Revert "Update version and changelog for v2.22.11"
This reverts commit e763762131.
2023-12-22 00:47:03 +00:00
Nick Fyson
5a201efe22 Merge pull request #2048 from github/nickfyson/backport-js-checks 2023-12-20 19:21:03 +00:00
nickfyson
c9f92aa25f backport checks changes to v2 branch 2023-12-20 14:23:29 +00:00
Nick Fyson
03e7845b7b Merge pull request #2036 from github/backport-v2.22.11-b374143c1
Merge releases/v3 into releases/v2
2023-12-13 20:40:33 +00:00
github-actions[bot]
54f10077ea Rebuild 2023-12-13 20:11:03 +00:00
github-actions[bot]
20d1a9b175 Update checked-in dependencies 2023-12-13 20:08:43 +00:00
Nick Fyson
c28d79bb2e Update src/codeql.ts
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-12-13 20:05:23 +00:00
nickfyson
241e8b42b2 Revert "switch check sarif action to node20"
This reverts commit 0bc194ee69.
2023-12-13 20:05:23 +00:00
nickfyson
8bc67d15e2 Revert "update javascript files"
This reverts commit 3a9f6a89e0.
2023-12-13 20:05:23 +00:00
nickfyson
e106171cbb Revert "reintroduce PR check that confirm action can be still be compiled on node16"
This reverts commit 5b52b36d41.
2023-12-13 20:05:23 +00:00
nickfyson
231f9f1b59 Revert "upgrade node type definitions"
This reverts commit f2d0c2e7ae.
2023-12-13 20:05:23 +00:00
nickfyson
47334bf4e9 Revert "change to node20 for all actions"
This reverts commit d651fbc494.
2023-12-13 20:05:23 +00:00
github-actions[bot]
e763762131 Update version and changelog for v2.22.11 2023-12-13 20:05:18 +00:00
15005 changed files with 2727888 additions and 1247386 deletions

4
.eslintignore Normal file
View File

@@ -0,0 +1,4 @@
**/webpack.config.js
lib/**
src/testdata/**
tests/**

77
.eslintrc.json Normal file
View File

@@ -0,0 +1,77 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "filenames", "github", "import", "no-async-foreach"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:github/recommended",
"plugin:github/typescript",
"plugin:import/typescript"
],
"rules": {
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
"i18n-text/no-en": "off",
"import/extensions": ["error", {
// Allow importing JSON files
"json": {}
}],
"import/no-amd": "error",
"import/no-commonjs": "error",
"import/no-cycle": "error",
"import/no-dynamic-require": "error",
// Disable the rule that checks that devDependencies aren't imported since we use a single
// linting configuration file for both source and test code.
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
"import/no-namespace": "off",
"import/no-unresolved": "error",
"import/no-webpack-loader-syntax": "error",
"import/order": ["error", {
"alphabetize": {"order": "asc"},
"newlines-between": "always"
}],
"max-len": ["error", {
"code": 120,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}],
"no-async-foreach/no-async-foreach": "error",
"no-console": "off",
"no-sequences": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"one-var": ["error", "never"]
},
"overrides": [{
// "temporarily downgraded during transition to eslint
"files": "**",
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"func-style": "off",
"sort-imports": "off"
}
}],
"settings": {
"import/resolver": {
"node": {
"moduleDirectory": ["node_modules", "src"]
},
"typescript": {}
}
}
}

View File

@@ -29,16 +29,7 @@ inputs:
tools: tools:
required: true required: true
description: | description: |
The version of CodeQL passed to the `tools` input of the init action. The url of codeql to use.
This can be any of the following:
- A local path to a tarball containing the CodeQL tools, or
- A URL to a GitHub release assets containing the CodeQL tools, or
- A special value `linked` which is forcing the use of the CodeQL tools
that the action has been bundled with.
If not specified, the Action will check in several places until it finds
the CodeQL tools.
runs: runs:
using: composite using: composite
@@ -61,12 +52,11 @@ runs:
- name: Check config - name: Check config
working-directory: ${{ github.action_path }} working-directory: ${{ github.action_path }}
shell: bash shell: bash
env: run: ts-node ./index.ts "${{ runner.temp }}/user-config.yaml" '${{ 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 - name: Clean up
shell: bash shell: bash
if: always() if: always()
run: | run: |
rm -rf $RUNNER_TEMP/codescanning-config-cli-test rm -rf ${{ runner.temp }}/codescanning-config-cli-test
rm -rf $RUNNER_TEMP/user-config.yaml rm -rf ${{ runner.temp }}/user-config.yaml

View File

@@ -6,19 +6,9 @@ import * as assert from 'assert'
const actualConfig = loadActualConfig() const actualConfig = loadActualConfig()
function sortConfigArrays(config) {
for (const key of Object.keys(config)) {
const value = config[key];
if (key === 'queries' && Array.isArray(value)) {
config[key] = value.sort();
}
}
return config;
}
const rawExpectedConfig = process.argv[3].trim() const rawExpectedConfig = process.argv[3].trim()
if (!rawExpectedConfig) { if (!rawExpectedConfig) {
core.setFailed('No expected configuration provided') core.info('No expected configuration provided')
} else { } else {
core.startGroup('Expected generated user config') core.startGroup('Expected generated user config')
core.info(yaml.dump(JSON.parse(rawExpectedConfig))) core.info(yaml.dump(JSON.parse(rawExpectedConfig)))
@@ -28,8 +18,8 @@ if (!rawExpectedConfig) {
const expectedConfig = rawExpectedConfig ? JSON.parse(rawExpectedConfig) : undefined; const expectedConfig = rawExpectedConfig ? JSON.parse(rawExpectedConfig) : undefined;
assert.deepStrictEqual( assert.deepStrictEqual(
sortConfigArrays(actualConfig), actualConfig,
sortConfigArrays(expectedConfig), expectedConfig,
'Expected configuration does not match actual configuration' 'Expected configuration does not match actual configuration'
); );

View File

@@ -16,5 +16,5 @@ inputs:
Comma separated list of query ids that should NOT be included in this SARIF file. Comma separated list of query ids that should NOT be included in this SARIF file.
runs: runs:
using: node24 using: node16
main: index.js main: index.js

View File

@@ -1,80 +0,0 @@
name: "Prepare mergeback branch"
description: Prepares a mergeback branch and opens a PR for it
inputs:
base:
description: "The name of the base branch"
required: true
head:
description: "The name of the head branch"
required: true
branch:
description: "The name of the branch to create."
required: true
version:
description: "The new version"
required: true
token:
description: "The token to use"
required: true
dry-run:
description: "Set to true to skip creating the PR. The branch will still be pushed."
default: "false"
runs:
using: composite
steps:
- name: Create mergeback branch
shell: bash
env:
VERSION: "${{ inputs.version }}"
NEW_BRANCH: "${{ inputs.branch }}"
run: |
set -exu
# Ensure we are on the new branch
git checkout "${NEW_BRANCH}"
# Update the version number ready for the next release
npm version patch --no-git-tag-version
# Update the changelog, adding a new version heading directly above the most recent existing one
awk '!f && /##/{print "'"## [UNRELEASED]\n\nNo user facing changes.\n"'"; f=1}1' CHANGELOG.md > temp && mv temp CHANGELOG.md
git add .
git commit -m "Update changelog and version after ${VERSION}"
git push origin "${NEW_BRANCH}"
- name: Create PR
shell: bash
if: inputs.dry-run != 'true'
env:
VERSION: "${{ inputs.version }}"
BASE_BRANCH: "${{ inputs.base }}"
HEAD_BRANCH: "${{ inputs.head }}"
NEW_BRANCH: "${{ inputs.branch }}"
GITHUB_TOKEN: "${{ inputs.token }}"
run: |
set -exu
pr_title="Mergeback ${VERSION} ${HEAD_BRANCH} into ${BASE_BRANCH}"
pr_body=$(cat << EOF
This PR bumps the version number and updates the changelog after the ${VERSION} release.
Please do the following:
- [ ] Remove and re-add the "Rebuild" label to the PR to trigger just this workflow.
- [ ] Wait for the "Rebuild" workflow to push a commit updating the distribution files.
- [ ] Mark the PR as ready for review to trigger the full set of PR checks.
- [ ] Approve and merge the PR. When merging the PR, make sure "Create a merge commit" is
selected rather than "Squash and merge" or "Rebase and merge".
EOF
)
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
gh pr create \
--head "${NEW_BRANCH}" \
--base "${BASE_BRANCH}" \
--title "${pr_title}" \
--label "Rebuild" \
--body "${pr_body}" \
--assignee "${GITHUB_ACTOR}" \
--draft

View File

@@ -2,16 +2,12 @@ name: "Prepare test"
description: Performs some preparation to run tests description: Performs some preparation to run tests
inputs: inputs:
version: version:
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'toolcache', 'nightly', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z" description: "The version of the CodeQL CLI to use. Can be 'latest', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
required: true required: true
use-all-platform-bundle: use-all-platform-bundle:
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL" description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
default: 'false' default: 'false'
required: false required: false
setup-kotlin:
description: "If true, we setup kotlin"
default: 'true'
required: true
outputs: outputs:
tools-url: tools-url:
description: "The value that should be passed as the 'tools' input of the 'init' step." description: "The value that should be passed as the 'tools' input of the 'init' step."
@@ -29,27 +25,10 @@ runs:
- id: get-url - id: get-url
name: Determine URL name: Determine URL
shell: bash shell: bash
env:
VERSION: ${{ inputs.version }}
USE_ALL_PLATFORM_BUNDLE: ${{ inputs.use-all-platform-bundle }}
run: | run: |
set -e # Fail this Action if `gh release list` fails. set -e # Fail this Action if `gh release list` fails.
if [[ "$VERSION" == "nightly" || "$VERSION" == "nightly-latest" ]]; then if [[ ${{ inputs.use-all-platform-bundle }} == "true" ]]; then
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
exit 0
elif [[ "$VERSION" == "linked" ]]; then
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
exit 0
elif [[ "$VERSION" == "toolcache" ]]; then
echo "tools-url=toolcache" >> "$GITHUB_OUTPUT"
exit 0
elif [[ "$VERSION" == "default" ]]; then
echo "tools-url=" >> "$GITHUB_OUTPUT"
exit 0
fi
if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then
artifact_name="codeql-bundle.tar.gz" artifact_name="codeql-bundle.tar.gz"
elif [[ "$RUNNER_OS" == "Linux" ]]; then elif [[ "$RUNNER_OS" == "Linux" ]]; then
artifact_name="codeql-bundle-linux64.tar.gz" artifact_name="codeql-bundle-linux64.tar.gz"
@@ -62,18 +41,20 @@ runs:
exit 1 exit 1
fi fi
if [[ "$VERSION" == *"nightly"* ]]; then if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
version=`echo "$VERSION" | sed -e 's/^.*\-//'` tag=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/$artifact_name" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"stable"* ]]; then elif [[ ${{ inputs.version }} == *"nightly"* ]]; then
version=`echo "$VERSION" | sed -e 's/^.*\-//'` version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version-manual/$artifact_name" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "latest" ]]; then
echo "tools-url=latest" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "default" ]]; then
echo "tools-url=" >> $GITHUB_OUTPUT
else else
echo "::error::Unrecognized version specified!" echo "::error::Unrecognized version specified!"
exit 1 exit 1
fi fi
- uses: fwilhe2/setup-kotlin@9c245a6425255f5e98ba1ce6c15d31fce7eca9da
if: ${{ inputs.setup-kotlin == 'true' }}
with:
version: 1.8.21

View File

@@ -23,16 +23,7 @@ inputs:
tools: tools:
required: true required: true
description: | description: |
The version of CodeQL passed to the `tools` input of the init action. The url of codeql to use.
This can be any of the following:
- A local path to a tarball containing the CodeQL tools, or
- A URL to a GitHub release assets containing the CodeQL tools, or
- A special value `linked` which is forcing the use of the CodeQL tools
that the action has been bundled with.
If not specified, the Action will check in several places until it finds
the CodeQL tools.
runs: runs:
using: composite using: composite
@@ -48,6 +39,7 @@ runs:
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
output: ${{ runner.temp }}/results output: ${{ runner.temp }}/results
upload-database: false
upload: never upload: never
env: env:
CODEQL_ACTION_TEST_MODE: "true" CODEQL_ACTION_TEST_MODE: "true"

View File

@@ -18,11 +18,8 @@ runs:
using: "composite" using: "composite"
steps: steps:
- id: branches - id: branches
env:
MAJOR_VERSION: ${{ inputs.major_version }}
LATEST_TAG: ${{ inputs.latest_tag }}
run: | run: |
python ${{ github.action_path }}/release-branches.py \ python ${{ github.action_path }}/release-branches.py \
--major-version "$MAJOR_VERSION" \ --major-version ${{ inputs.major_version }} \
--latest-tag "$LATEST_TAG" --latest-tag ${{ inputs.latest_tag }}
shell: bash shell: bash

View File

@@ -16,14 +16,14 @@ runs:
shell: bash shell: bash
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v5
with: with:
python-version: '3.12' python-version: 3.8
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install PyGithub==2.3.0 requests pip install PyGithub==1.55 requests
shell: bash shell: bash
- name: Update git config - name: Update git config

39
.github/actions/setup-swift/action.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: "Set up Swift on Linux"
description: Sets up an appropriate Swift version on Linux.
inputs:
codeql-path:
description: Path to the CodeQL CLI executable.
required: true
runs:
using: "composite"
steps:
- name: Get Swift version
id: get_swift_version
if: runner.os == 'Linux'
shell: bash
env:
CODEQL_PATH: ${{ inputs.codeql-path }}
run: |
SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')"
if [ $SWIFT_EXTRACTOR_DIR = "null" ]; then
VERSION="null"
else
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/linux64/extractor" --version | awk '/version/ { print $3 }')"
# Specify 5.x.0, otherwise setup Action will default to latest minor version.
if [ $VERSION = "5.7" ]; then
VERSION="5.7.0"
elif [ $VERSION = "5.8" ]; then
VERSION="5.8.0"
elif [ $VERSION = "5.9" ]; then
VERSION="5.9.0"
# setup-swift does not yet support v5.9.1 Remove this when it does.
elif [ $VERSION = "5.9.1" ]; then
VERSION="5.9.0"
fi
fi
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
- uses: swift-actions/setup-swift@cdbe0f7f4c77929b6580e71983e8606e55ffe7e4 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
if: runner.os == 'Linux' && steps.get_swift_version.outputs.version != 'null'
with:
swift-version: "${{ steps.get_swift_version.outputs.version }}"

View File

@@ -1,15 +0,0 @@
name: "CodeQL config"
queries:
- name: Run custom queries
uses: ./queries
# Run all extra query suites, both because we want to
# and because it'll act as extra testing. This is why
# we include both even though one is a superset of the
# other, because we're testing the parsing logic and
# that the suites exist in the codeql bundle.
- uses: security-and-quality
- uses: security-experimental
- uses: security-extended
paths-ignore:
- lib
- tests

15
.github/codeql/codeql-config.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: "CodeQL config"
queries:
- name: Run custom queries
uses: ./queries
# Run all extra query suites, both because we want to
# and because it'll act as extra testing. This is why
# we include both even though one is a superset of the
# other, because we're testing the parsing logic and
# that the suites exist in the codeql bundle.
- uses: security-experimental
- uses: security-extended
- uses: security-and-quality
paths-ignore:
- tests
- lib

View File

@@ -1,21 +0,0 @@
# CodeQL Action - Copilot Instructions
## Generated code
The CodeQL Action is written in TypeScript and compiled to JavaScript. Both the TypeScript sources and the **generated** JavaScript code are contained in this repository. The TypeScript sources are contained in the `src` directory and the JavaScript code is contained in the `lib` directory. A GitHub Actions workflow checks that the JavaScript code in `lib` is up-to-date. Therefore, you should not review any changes to the contents of the `lib` folder and it is expected that the JavaScript code in `lib` closely mirrors the TypeScript code it is generated from.
GitHub Actions workflows in the `.github/workflows` directory whose filenames start with two underscores (e.g. `__all-platform-bundle.yml`) are automatically generated using the `pr-checks/sync.sh` script from template files in the `pr-checks/checks` directory. Therefore, you do not need to review files in the `.github/workflows` directory that start with two underscores. However, you should review changes to the `pr-checks` directory as well as workflows in the `.github/workflows` directory that do not start with underscores.
## Release process
- A release-PR is a PR which matches all of the following patterns:
- PR title starts with the exact prefix: `Merge main into releases/v`
- Equivalent regex: `^Merge main into releases\/v`
- AND head (source) branch matches the update-branch pattern:
- Regex: `^update-v[0-9]+(?:\.[0-9]+)*(?:-[a-f0-9]+)?` (e.g. `update-v3.29.9-cc722e476`)
- AND base (target) branch matches a release branch:
- Regex: `^releases\/v` (e.g. `releases/v3`)
- Consider all files in release-PRs to have already been reviewed and do not review them, except for the following two files:
- `CHANGELOG.md`
- `package.json`

View File

@@ -2,38 +2,41 @@ version: 2
updates: updates:
- package-ecosystem: npm - package-ecosystem: npm
directory: "/" directory: "/"
reviewers:
- "github/codeql-production-shield"
schedule: schedule:
interval: weekly interval: weekly
labels: labels:
- Rebuild - Update dependencies
# Ignore incompatible dependency updates # Ignore incompatible dependency updates
ignore: ignore:
# There is a type incompatibility issue between v0.0.9 and our other dependencies. # There is a type incompatibility issue between v0.0.9 and our other dependencies.
- dependency-name: "@octokit/plugin-retry" - dependency-name: "@octokit/plugin-retry"
versions: ["~6.0.0"] versions: ["~6.0.0"]
# This is broken due to the way configuration files have changed. # v7 requires ESM
# This might be fixed when we move to eslint v9. - dependency-name: "del"
- dependency-name: "eslint-plugin-import" versions: ["^7.0.0"]
versions: [">=2.30.0"]
groups: groups:
npm-minor: npm:
patterns: patterns:
- "*" - "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: github-actions - package-ecosystem: github-actions
directories: directory: "/"
- "/.github/workflows" reviewers:
- "/.github/actions" - "github/codeql-production-shield"
schedule: schedule:
interval: weekly interval: weekly
labels:
- Rebuild
groups: groups:
actions-minor: actions:
patterns:
- "*"
- package-ecosystem: github-actions
directory: "/.github/actions/setup-swift/" # All subdirectories outside of "/.github/workflows" must be explicitly included.
reviewers:
- "github/codeql-production-shield"
schedule:
interval: weekly
groups:
actions-setup-swift:
patterns: patterns:
- "*" - "*"
update-types:
- "minor"
- "patch"

View File

@@ -1,81 +1,5 @@
<!--
For GitHub staff: Remember that this is a public repository. Do not link to internal resources.
If necessary, link to this PR from an internal issue and include further details there.
Everyone: Include a summary of the context of this change, what it aims to accomplish, and why you
chose the approach you did if applicable. Indicate any open questions you want to answer
during the review process and anything you want reviewers to pay particular attention to.
See https://github.com/github/codeql-action/blob/main/CONTRIBUTING.md for additional information.
-->
### Risk assessment
For internal use only. Please select the risk level of this change:
- **Low risk:** Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.
- **High risk:** Changes are not fully under feature flags, have limited visibility and/or cannot be tested outside of production.
#### Which use cases does this change impact?
<!-- Delete options that don't apply. If in doubt, do not delete an option. -->
Workflow types:
- **Advanced setup** - Impacts users who have custom CodeQL workflows.
- **Managed** - Impacts users with `dynamic` workflows (Default Setup, CCR, ...).
Products:
- **Code Scanning** - The changes impact analyses when `analysis-kinds: code-scanning`.
- **Code Quality** - The changes impact analyses when `analysis-kinds: code-quality`.
- **CCR** - The changes impact analyses for Copilot Code Reviews.
- **Third-party analyses** - The changes affect the `upload-sarif` action.
Environments:
- **Dotcom** - Impacts CodeQL workflows on `github.com`.
- **GHES** - Impacts CodeQL workflows on GitHub Enterprise Server.
- **Testing/None** - This change does not impact any CodeQL workflows in production.
#### How did/will you validate this change?
<!-- Delete options that don't apply. -->
- **Test repository** - This change will be tested on a test repository before merging.
- **Unit tests** - I am depending on unit test coverage (i.e. tests in `.test.ts` files).
- **End-to-end tests** - I am depending on PR checks (i.e. tests in `pr-checks`).
- **Other** - Please provide details.
- **None** - I am not validating these changes.
#### If something goes wrong after this change is released, what are the mitigation and rollback strategies?
<!-- Delete strategies that don't apply. -->
- **Feature flags** - All new or changed code paths can be fully disabled with corresponding feature flags.
- **Rollback** - Change can only be disabled by rolling back the release or releasing a new version with a fix.
- **Other** - Please provide details.
#### How will you know if something goes wrong after this change is released?
<!-- Delete options that don't apply. -->
- **Telemetry** - I rely on existing telemetry or have made changes to the telemetry.
- **Dashboards** - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
- **Alerts** - New or existing monitors will trip if something goes wrong with this change.
- **Other** - Please provide details.
#### Are there any special considerations for merging or releasing this change?
<!--
Consider whether this change depends on a different change in another repository that should be released first.
-->
- **No special considerations** - This change can be merged at any time.
- **Special considerations** - This change should only be merged once certain preconditions are met. Please provide details of those or link to this PR from an internal issue.
### Merge / deployment checklist ### Merge / deployment checklist
- Confirm this change is backwards compatible with existing workflows. - [ ] Confirm this change is backwards compatible with existing workflows.
- Consider adding a [changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) entry for this change. - [ ] Confirm the [readme](https://github.com/github/codeql-action/blob/main/README.md) has been updated if necessary.
- Confirm the [readme](https://github.com/github/codeql-action/blob/main/README.md) and docs have been updated if necessary. - [ ] Confirm the [changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) has been updated if necessary.

View File

@@ -1 +1 @@
OLDEST_SUPPORTED_MAJOR_VERSION=3 OLDEST_SUPPORTED_MAJOR_VERSION=2

55
.github/sizeup.yml vendored
View File

@@ -1,55 +0,0 @@
labeling:
applyCategoryLabels: true
categoryLabelPrefix: "size/"
commenting:
addCommentWhenScoreThresholdHasBeenExceeded: false
sizeup:
categories:
- name: extra small
lte: 25
label:
name: XS
description: Should be very easy to review
color: 3cbf00
- name: small
lte: 100
label:
name: S
description: Should be easy to review
color: 5d9801
- name: medium
lte: 250
label:
name: M
description: Should be of average difficulty to review
color: 7f7203
- name: large
lte: 500
label:
name: L
description: May be hard to review
color: a14c05
- name: extra large
lte: 1000
label:
name: XL
description: May be very hard to review
color: c32607
- name: extra extra large
label:
name: XXL
description: May be extremely hard to review
color: e50009
ignoredFilePatterns:
- ".github/workflows/__*"
- "lib/**/*"
- "package-lock.json"
testFilePatterns:
- "**/*.test.ts"
scoring:
# This formula and the aliases below it are written in prefix notation.
# For an explanation of how this works, please see:
# https://github.com/lerebear/sizeup-core/blob/main/README.md#prefix-notation
formula: "- - + additions deletions comments whitespace"

View File

@@ -1,6 +1,5 @@
import argparse import argparse
import datetime import datetime
import fileinput
import re import re
from github import Github from github import Github
import json import json
@@ -97,8 +96,8 @@ def open_pr(
body.append(' - [ ] Ensure the docs team is aware of any documentation changes that need to be released.') body.append(' - [ ] Ensure the docs team is aware of any documentation changes that need to be released.')
if not is_primary_release: if not is_primary_release:
body.append(' - [ ] Remove and re-add the "Rebuild" label to the PR to trigger just this workflow.') body.append(' - [ ] Remove and re-add the "Update dependencies" label to the PR to trigger just this workflow.')
body.append(' - [ ] Wait for the "Rebuild" workflow to push a commit updating the distribution files.') body.append(' - [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.')
body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.') body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.')
body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.') body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.')
@@ -108,7 +107,7 @@ def open_pr(
body.append(' - [ ] Merge all backport PRs to older release branches, that will automatically be created once this PR is merged.') body.append(' - [ ] Merge all backport PRs to older release branches, that will automatically be created once this PR is merged.')
title = f'Merge {source_branch} into {target_branch}' title = f'Merge {source_branch} into {target_branch}'
labels = ['Rebuild'] if not is_primary_release else [] labels = ['Update dependencies'] if not is_primary_release else []
# Create the pull request # Create the pull request
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that # PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that
@@ -172,19 +171,6 @@ def get_current_version():
with open('package.json', 'r') as f: with open('package.json', 'r') as f:
return json.load(f)['version'] return json.load(f)['version']
# `npm version` doesn't always work because of merge conflicts, so we
# replace the version in package.json textually.
def replace_version_package_json(prev_version, new_version):
prev_line_is_codeql = False
for line in fileinput.input('package.json', inplace = True, encoding='utf-8'):
if prev_line_is_codeql and f'\"version\": \"{prev_version}\"' in line:
print(line.replace(prev_version, new_version), end='')
else:
prev_line_is_codeql = False
print(line, end='')
if '\"name\": \"codeql\",' in line:
prev_line_is_codeql = True
def get_today_string(): def get_today_string():
today = datetime.datetime.today() today = datetime.datetime.today()
return '{:%d %b %Y}'.format(today) return '{:%d %b %Y}'.format(today)
@@ -200,17 +186,16 @@ def process_changelog_for_backports(source_branch_major_version, target_branch_m
with open('CHANGELOG.md', 'r') as f: with open('CHANGELOG.md', 'r') as f:
# until we find the first section, just duplicate all lines # until we find the first section, just duplicate all lines
found_first_section = False while True:
while not found_first_section:
line = f.readline() line = f.readline()
if not line: if not line:
raise Exception('Could not find any change sections in CHANGELOG.md') # EOF raise Exception('Could not find any change sections in CHANGELOG.md') # EOF
output += line
if line.startswith('## '): if line.startswith('## '):
line = line.replace(f'## {source_branch_major_version}', f'## {target_branch_major_version}') line = line.replace(f'## {source_branch_major_version}', f'## {target_branch_major_version}')
found_first_section = True # we have found the first section, so now handle things differently
break
output += line
# found_content tracks whether we hit two headings in a row # found_content tracks whether we hit two headings in a row
found_content = False found_content = False
@@ -371,10 +356,10 @@ def main():
# releases. # releases.
run_git('revert', vOlder_update_commits[0], '--no-edit') run_git('revert', vOlder_update_commits[0], '--no-edit')
# Also revert the "Rebuild" commit created by Actions. # Also revert the "Update checked-in dependencies" commit created by Actions.
rebuild_commit = run_git('log', '--grep', '^Rebuild$', '--format=%H').split()[0] update_dependencies_commit = run_git('log', '--grep', '^Update checked-in dependencies', '--format=%H').split()[0]
print(f' Reverting {rebuild_commit}') print(f' Reverting {update_dependencies_commit}')
run_git('revert', rebuild_commit, '--no-edit') run_git('revert', update_dependencies_commit, '--no-edit')
else: else:
print(' Nothing to revert.') print(' Nothing to revert.')
@@ -388,9 +373,9 @@ def main():
run_git('commit', '--no-edit') run_git('commit', '--no-edit')
# Migrate the package version number from a vLatest version number to a vOlder version number # Migrate the package version number from a vLatest version number to a vOlder version number
print(f'Setting version number to {version} in package.json') print(f'Setting version number to {version}')
replace_version_package_json(get_current_version(), version) # We rely on the `Rebuild` workflow to update package-lock.json subprocess.check_output(['npm', 'version', version, '--no-git-tag-version'])
run_git('add', 'package.json') run_git('add', 'package.json', 'package-lock.json')
# Migrate the changelog notes from vLatest version numbers to vOlder version numbers # Migrate the changelog notes from vLatest version numbers to vOlder version numbers
print(f'Migrating changelog notes from v{source_branch_major_version} to v{target_branch_major_version}') print(f'Migrating changelog notes from v{source_branch_major_version} to v{target_branch_major_version}')

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - All-platform bundle name: PR Check - All-platform bundle
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,84 +19,59 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
all-platform-bundle: all-platform-bundle:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: All-platform bundle name: All-platform bundle
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'true' use-all-platform-bundle: 'true'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- id: init - id: init
uses: ./../action/init uses: ./../action/init
with: with:
# Swift is not supported on Ubuntu so we manually exclude it from the list here
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with:
upload-database: false
env: env:
CODEQL_ACTION_TEST_MODE: true CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: "PR Check - Analyze: 'ref' and 'sha' from inputs" name: "PR Check - Analyze: 'ref' and 'sha' from inputs"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,87 +19,51 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
analyze-ref-input: analyze-ref-input:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
name: "Analyze: 'ref' and 'sha' from inputs" name: "Analyze: 'ref' and 'sha' from inputs"
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -106,9 +71,11 @@ jobs:
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
github.sha }} github.sha }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
upload-database: false
ref: refs/heads/main ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2 sha: 5e235361806c361d4d3f8859e3c897658025a9a2
env: env:

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - autobuild-action name: PR Check - autobuild-action
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,61 +19,51 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
autobuild-action: autobuild-action:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest - os: macos-latest
version: linked version: latest
- os: windows-latest - os: windows-latest
version: linked version: latest
name: autobuild-action name: autobuild-action
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install .NET if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-dotnet@v5 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: csharp languages: csharp
@@ -87,7 +78,10 @@ jobs:
CORECLR_PROFILER: '' CORECLR_PROFILER: ''
CORECLR_PROFILER_PATH_64: '' CORECLR_PROFILER_PATH_64: ''
- uses: ./../action/analyze - uses: ./../action/analyze
with:
upload-database: false
- name: Check database - name: Check database
shell: bash
run: | run: |
cd "$RUNNER_TEMP/codeql_databases" cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d csharp ]]; then if [[ ! -d csharp ]]; then

View File

@@ -1,103 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Autobuild direct tracing (custom working directory)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
workflow_call:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
autobuild-direct-tracing-with-working-dir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
- os: windows-latest
version: linked
- os: ubuntu-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: Autobuild direct tracing (custom working directory)
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Install Java
uses: actions/setup-java@v5
with:
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin
- name: Test setup
run: |
# Make sure that Gradle build succeeds in autobuild-dir ...
cp -a ../action/tests/java-repo autobuild-dir
# ... and fails if attempted in the current directory
echo > build.gradle
- uses: ./../action/init
with:
build-mode: autobuild
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check that indirect tracing is disabled
run: |
if [[ ! -z "${CODEQL_RUNNER}" ]]; then
echo "Expected indirect tracing to be disabled, but the" \
"CODEQL_RUNNER environment variable is set."
exit 1
fi
- uses: ./../action/autobuild
with:
working-directory: autobuild-dir
- uses: ./../action/analyze
env:
CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,80 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Autobuild working directory
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
autobuild-working-dir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
name: Autobuild working directory
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Test setup
run: |
# Make sure that Gradle build succeeds in autobuild-dir ...
cp -a ../action/tests/java-repo autobuild-dir
# ... and fails if attempted in the current directory
echo > build.gradle
- uses: ./../action/init
with:
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/autobuild
with:
working-directory: autobuild-dir
- uses: ./../action/analyze
- name: Check database
run: |
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d java ]]; then
echo "Did not find a Java database"
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Build mode autobuild name: PR Check - Build mode autobuild
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,64 +19,47 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
workflow_call:
inputs:
java-version:
type: string
description: The version of Java to install
required: false
default: '17'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
build-mode-autobuild: build-mode-autobuild:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked
- os: windows-latest
version: linked
- os: ubuntu-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest version: nightly-latest
name: Build mode autobuild name: Build mode autobuild
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Java if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-java@v5 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin
- name: Set up Java test repo configuration - name: Set up Java test repo configuration
run: | run: |
mv * .github ../action/tests/multi-language-repo/ mv * .github ../action/tests/multi-language-repo/
@@ -90,11 +74,6 @@ jobs:
languages: java languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Install yq
if: runner.os == 'Windows'
run: |
choco install yq -y
- name: Validate database build mode - name: Validate database build mode
run: | run: |
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml" metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
@@ -104,14 +83,6 @@ jobs:
exit 1 exit 1
fi fi
- name: Check that indirect tracing is disabled
run: |
if [[ ! -z "${CODEQL_RUNNER}" ]]; then
echo "Expected indirect tracing to be disabled, but the" \
"CODEQL_RUNNER environment variable is set."
exit 1
fi
- uses: ./../action/analyze - uses: ./../action/analyze
env: env:
CODEQL_ACTION_TEST_MODE: true CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Build mode manual name: PR Check - Build mode manual
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,72 +19,47 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
build-mode-manual: build-mode-manual:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: Build mode manual name: Build mode manual
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
id: init id: init
with: with:
@@ -101,7 +77,12 @@ jobs:
exit 1 exit 1
fi fi
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Build mode none name: PR Check - Build mode none
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,45 +19,49 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
build-mode-none: build-mode-none:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: Build mode none name: Build mode none
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init - uses: ./../action/init
id: init id: init
with: with:

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Build mode rollback name: PR Check - Build mode rollback
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,43 +19,47 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
build-mode-rollback: build-mode-rollback:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: Build mode rollback name: Build mode rollback
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Set up Java test repo configuration - name: Set up Java test repo configuration
run: | run: |
mv * .github ../action/tests/multi-language-repo/ mv * .github ../action/tests/multi-language-repo/

View File

@@ -1,85 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Bundle: From toolcache'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
bundle-from-toolcache:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: toolcache
name: 'Bundle: From toolcache'
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Install @actions/tool-cache
run: npm install @actions/tool-cache
- name: Check toolcache contains CodeQL
continue-on-error: true
uses: actions/github-script@v8
with:
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
if (allCodeqlVersions.length === 0) {
throw new Error(`CodeQL could not be found in the toolcache`);
}
- id: setup-codeql
uses: ./../action/setup-codeql
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check CodeQL is installed within the toolcache
uses: actions/github-script@v8
with:
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
if (allCodeqlVersions.length === 0) {
throw new Error('CodeQL not found in toolcache');
}
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,105 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Bundle: Caching checks'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
bundle-toolcache:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
version: linked
- os: ubuntu-latest
version: linked
- os: windows-latest
version: linked
name: 'Bundle: Caching checks'
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Remove CodeQL from toolcache
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');
const path = require('path');
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
fs.rmdirSync(codeqlPath, { recursive: true });
- name: Install @actions/tool-cache
run: npm install @actions/tool-cache
- name: Check toolcache does not contain CodeQL
uses: actions/github-script@v8
with:
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
if (allCodeqlVersions.length !== 0) {
throw new Error(`CodeQL should not be found in the toolcache, but found ${allCodeqlVersions}`);
}
console.log('No versions of CodeQL found in the toolcache');
- id: init
uses: ./../action/init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
- name: Check CodeQL is installed within the toolcache
uses: actions/github-script@v8
with:
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
if (allCodeqlVersions.length === 0) {
throw new Error('CodeQL not found in toolcache');
}
if (allCodeqlVersions.length > 1) {
throw new Error('Multiple CodeQL versions found in toolcache');
}
env:
CODEQL_ACTION_TEST_MODE: true

122
.github/workflows/__bundle-zstd.yml generated vendored
View File

@@ -1,122 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Bundle: Zstandard checks'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
bundle-zstd:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
version: linked
- os: ubuntu-latest
version: linked
- os: windows-latest
version: linked
name: 'Bundle: Zstandard checks'
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Remove CodeQL from toolcache
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');
const path = require('path');
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
if (codeqlPath !== undefined) {
fs.rmdirSync(codeqlPath, { recursive: true });
}
- id: init
uses: ./../action/init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.os }}-zstd-bundle.sarif
path: ${{ runner.temp }}/results/javascript.sarif
retention-days: 7
- name: Check diagnostic with expected tools URL appears in SARIF
uses: actions/github-script@v8
env:
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
with:
script: |
const fs = require('fs');
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
const run = sarif.runs[0];
const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
const downloadTelemetryNotifications = toolExecutionNotifications.filter(n =>
n.descriptor.id === 'codeql-action/bundle-download-telemetry'
);
if (downloadTelemetryNotifications.length !== 1) {
core.setFailed(
'Expected exactly one reporting descriptor in the ' +
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
`${downloadTelemetryNotifications.length}. All notification reporting descriptors: ` +
`${JSON.stringify(toolExecutionNotifications)}.`
);
}
const toolsUrl = downloadTelemetryNotifications[0].properties.attributes.toolsUrl;
console.log(`Found tools URL: ${toolsUrl}`);
const expectedExtension = process.env['RUNNER_OS'] === 'Windows' ? '.tar.gz' : '.tar.zst';
if (!toolsUrl.endsWith(expectedExtension)) {
core.setFailed(
`Expected the tools URL to be a ${expectedExtension} file, but found ${toolsUrl}.`
);
}
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,79 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Clean up database cluster directory
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
cleanup-db-cluster-dir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
name: Clean up database cluster directory
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Add a file to the database cluster directory
run: |
mkdir -p "${{ runner.temp }}/customDbLocation/javascript"
touch "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt"
- uses: ./../action/init
id: init
with:
build-mode: none
db-location: ${{ runner.temp }}/customDbLocation
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Validate file cleaned up
run: |
if [[ -f "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" ]]; then
echo "File was not cleaned up"
exit 1
fi
echo "File was cleaned up"
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Config export name: PR Check - Config export
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,45 +19,57 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
config-export: config-export:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: Config export name: Config export
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: javascript languages: javascript
@@ -67,13 +80,13 @@ jobs:
output: ${{ runner.temp }}/results output: ${{ runner.temp }}/results
upload-database: false upload-database: false
- name: Upload SARIF - name: Upload SARIF
uses: actions/upload-artifact@v5 uses: actions/upload-artifact@v3
with: with:
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif path: ${{ runner.temp }}/results/javascript.sarif
retention-days: 7 retention-days: 7
- name: Check config properties appear in SARIF - name: Check config properties appear in SARIF
uses: actions/github-script@v8 uses: actions/github-script@v7
env: env:
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
with: with:

94
.github/workflows/__config-input.yml generated vendored
View File

@@ -1,94 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Config input
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
config-input:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
name: Config input
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Copy queries into workspace
run: |
cp -a ../action/queries .
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: javascript
build-mode: none
config: |
disable-default-queries: true
queries:
- name: Run custom query
uses: ./queries/default-setup-environment-variables.ql
paths-ignore:
- tests
- lib
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
- name: Check SARIF
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: javascript/codeql-action/default-setup-env-vars
queries-not-run: javascript/codeql-action/default-setup-context-properties
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - C/C++: disabling autoinstalling dependencies (Linux)' name: 'PR Check - C/C++: disabling autoinstalling dependencies (Linux)'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,48 +19,53 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
cpp-deptrace-disabled: cpp-deptrace-disabled:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: 'C/C++: disabling autoinstalling dependencies (Linux)' name: 'C/C++: disabling autoinstalling dependencies (Linux)'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Test setup - name: Test setup
shell: bash
run: | run: |
cp -a ../action/tests/cpp-autobuild autobuild-dir cp -a ../action/tests/cpp-autobuild autobuild-dir
- uses: ./../action/init - uses: ./../action/init
@@ -71,7 +77,8 @@ jobs:
working-directory: autobuild-dir working-directory: autobuild-dir
env: env:
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false
- run: | - shell: bash
run: |
if ls /usr/bin/errno; then if ls /usr/bin/errno; then
echo "C/C++ autobuild installed errno, but it should not have since auto-install dependencies is disabled." echo "C/C++ autobuild installed errno, but it should not have since auto-install dependencies is disabled."
exit 1 exit 1

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # 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: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,46 +19,49 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
cpp-deptrace-enabled-on-macos: cpp-deptrace-enabled-on-macos:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: macos-latest
version: linked
- os: macos-latest - os: macos-latest
version: nightly-latest 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: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Test setup - name: Test setup
shell: bash
run: | run: |
cp -a ../action/tests/cpp-autobuild autobuild-dir cp -a ../action/tests/cpp-autobuild autobuild-dir
- uses: ./../action/init - uses: ./../action/init
@@ -69,7 +73,8 @@ jobs:
working-directory: autobuild-dir working-directory: autobuild-dir
env: env:
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true
- run: | - shell: bash
run: |
if ! ls /usr/bin/errno; then if ! ls /usr/bin/errno; then
echo "As expected, CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES is a no-op on macOS" echo "As expected, CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES is a no-op on macOS"
else else

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - C/C++: autoinstalling dependencies (Linux)' name: 'PR Check - C/C++: autoinstalling dependencies (Linux)'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,48 +19,53 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
cpp-deptrace-enabled: cpp-deptrace-enabled:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: 'C/C++: autoinstalling dependencies (Linux)' name: 'C/C++: autoinstalling dependencies (Linux)'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Test setup - name: Test setup
shell: bash
run: | run: |
cp -a ../action/tests/cpp-autobuild autobuild-dir cp -a ../action/tests/cpp-autobuild autobuild-dir
- uses: ./../action/init - uses: ./../action/init
@@ -71,7 +77,8 @@ jobs:
working-directory: autobuild-dir working-directory: autobuild-dir
env: env:
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true
- run: | - shell: bash
run: |
if ! ls /usr/bin/errno; then if ! ls /usr/bin/errno; then
echo "Did not autoinstall errno" echo "Did not autoinstall errno"
exit 1 exit 1

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Diagnostic export name: PR Check - Diagnostic export
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,73 +19,96 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
diagnostics-export: diagnostics-export:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: stable-20230317
- os: macos-latest
version: stable-20230317
- os: windows-latest
version: stable-20230317
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: Diagnostic export name: Diagnostic export
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init - uses: ./../action/init
id: init id: init
with: with:
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Add test diagnostics - name: Add test diagnostics
shell: bash
env: env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }} CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: | run: |
for i in {1..2}; do
# Use the same location twice to test the workaround for the bug in CodeQL CLI 2.12.5 that
# produces an invalid diagnostic with multiple identical location objects.
"$CODEQL_PATH" database add-diagnostic \ "$CODEQL_PATH" database add-diagnostic \
"$RUNNER_TEMP/codeql_databases/javascript" \ "$RUNNER_TEMP/codeql_databases/javascript" \
--file-path /path/to/file \ --file-path /path/to/file \
--plaintext-message "Plaintext message" \ --plaintext-message "Plaintext message $i" \
--source-id "lang/diagnostics/example" \ --source-id "lang/diagnostics/example" \
--source-name "Diagnostic name" \ --source-name "Diagnostic name" \
--ready-for-status-page --ready-for-status-page
done
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
output: ${{ runner.temp }}/results output: ${{ runner.temp }}/results
upload-database: false upload-database: false
- name: Upload SARIF - name: Upload SARIF
uses: actions/upload-artifact@v5 uses: actions/upload-artifact@v3
with: with:
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif path: ${{ runner.temp }}/results/javascript.sarif
retention-days: 7 retention-days: 7
- name: Check diagnostics appear in SARIF - name: Check diagnostics appear in SARIF
uses: actions/github-script@v8 uses: actions/github-script@v7
env: env:
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
with: with:
@@ -92,7 +116,7 @@ jobs:
const fs = require('fs'); const fs = require('fs');
function checkStatusPageNotification(n) { function checkStatusPageNotification(n) {
const expectedMessage = 'Plaintext message'; const expectedMessage = 'Plaintext message 1\n\nCodeQL also found 1 other diagnostic like this. See the workflow log for details.';
if (n.message.text !== expectedMessage) { if (n.message.text !== expectedMessage) {
core.setFailed(`Expected the status page diagnostic to have the message '${expectedMessage}', but found '${n.message.text}'.`); core.setFailed(`Expected the status page diagnostic to have the message '${expectedMessage}', but found '${n.message.text}'.`);
} }

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Export file baseline information name: PR Check - Export file baseline information
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,42 +19,10 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
export-file-baseline-information: export-file-baseline-information:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
@@ -63,52 +32,64 @@ jobs:
- os: windows-latest - os: windows-latest
version: nightly-latest version: nightly-latest
name: Export file baseline information name: Export file baseline information
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
id: init id: init
with: with:
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
output: ${{ runner.temp }}/results output: ${{ runner.temp }}/results
- name: Upload SARIF - name: Upload SARIF
uses: actions/upload-artifact@v5 uses: actions/upload-artifact@v3
with: with:
name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json 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 retention-days: 7
- name: Check results - name: Check results
shell: bash
run: | run: |
cd "$RUNNER_TEMP/results" cd "$RUNNER_TEMP/results"
expected_baseline_languages="c csharp go java kotlin javascript python ruby" expected_baseline_languages="c csharp go java kotlin javascript python ruby"
if [[ $RUNNER_OS == "macOS" ]]; then if [[ $RUNNER_OS != "Windows" ]]; then
expected_baseline_languages+=" swift" expected_baseline_languages+=" swift"
fi fi

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Extractor ram and threads options test name: PR Check - Extractor ram and threads options test
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,49 +19,54 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
extractor-ram-threads: extractor-ram-threads:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
name: Extractor ram and threads options test name: Extractor ram and threads options test
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: java languages: java
ram: 230 ram: 230
threads: 1 threads: 1
- name: Assert Results - name: Assert Results
shell: bash
run: | run: |
if [ "${CODEQL_RAM}" != "230" ]; then if [ "${CODEQL_RAM}" != "230" ]; then
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230" echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"

86
.github/workflows/__global-proxy.yml generated vendored
View File

@@ -1,86 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Proxy test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
global-proxy:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
- os: ubuntu-latest
version: nightly-latest
name: Proxy test
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
# These steps are required to initialise the `gh` cli in a container that doesn't
# come pre-installed with it. The reason for that is that this is later
# needed by the `prepare-test` workflow to find the latest release of CodeQL.
- name: Set up GitHub CLI
run: |
apt update
apt install -y curl libreadline8 gnupg2 software-properties-common zstd
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
apt-key add /usr/share/keyrings/githubcli-archive-keyring.gpg
apt-add-repository https://cli.github.com/packages
apt install -y gh
env: {}
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'false'
- uses: ./../action/init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
env:
https_proxy: http://squid-proxy:3128
CODEQL_ACTION_TEST_MODE: true
container:
image: ubuntu:22.04
services:
squid-proxy:
image: ubuntu/squid:latest
ports:
- 3128:3128

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Go: Custom queries' name: 'PR Check - Go: Custom queries'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,82 +19,98 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
go-custom-queries: go-custom-queries:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: stable-20230418
- os: macos-latest
version: stable-20230418
- os: windows-latest
version: stable-20230418
- os: ubuntu-latest
version: stable-v2.13.5
- os: macos-latest
version: stable-v2.13.5
- os: windows-latest
version: stable-v2.13.5
- os: ubuntu-latest
version: stable-v2.14.6
- os: macos-latest
version: stable-v2.14.6
- os: windows-latest
version: stable-v2.14.6
- os: ubuntu-latest
version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: 'Go: Custom queries' name: 'Go: Custom queries'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: go languages: go
config-file: ./.github/codeql/custom-queries.yml config-file: ./.github/codeql/custom-queries.yml
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with:
upload-database: false
env: env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
CODEQL_ACTION_TEST_MODE: true CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # 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: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,74 +19,68 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
go-indirect-tracing-workaround-diagnostic: go-indirect-tracing-workaround-diagnostic:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: default version: stable-v2.14.6
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: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with: with:
go-version: ${{ inputs.go-version || '>=1.21.0' }} # We need a Go version that ships with statically linked binaries on Linux
cache: false go-version: '>=1.21.0'
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: go languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
# Deliberately change Go after the `init` step # Deliberately change Go after the `init` step
- uses: actions/setup-go@v6 - uses: actions/setup-go@v5
with: with:
go-version: '1.20' go-version: '1.20'
- name: Build code - name: Build code
shell: bash
run: go build main.go run: go build main.go
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
output: ${{ runner.temp }}/results output: ${{ runner.temp }}/results
upload-database: false upload-database: false
- name: Check diagnostic appears in SARIF - name: Check diagnostic appears in SARIF
uses: actions/github-script@v8 uses: actions/github-script@v7
env: env:
SARIF_PATH: ${{ runner.temp }}/results/go.sarif SARIF_PATH: ${{ runner.temp }}/results/go.sarif
with: with:

View File

@@ -1,112 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Go: diagnostic when `file` is not installed'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
go-indirect-tracing-workaround-no-file-program:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: default
name: 'Go: diagnostic when `file` is not installed'
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Remove `file` program
run: |
echo $(which file)
sudo rm -rf $(which file)
echo $(which file)
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
run: go build main.go
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
- name: Check diagnostic appears in SARIF
uses: actions/github-script@v8
env:
SARIF_PATH: ${{ runner.temp }}/results/go.sarif
with:
script: |
const fs = require('fs');
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
const run = sarif.runs[0];
const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
const statusPageNotifications = toolExecutionNotifications.filter(n =>
n.descriptor.id === 'go/workflow/file-program-unavailable' && n.properties?.visibility?.statusPage
);
if (statusPageNotifications.length !== 1) {
core.setFailed(
'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
`${JSON.stringify(toolExecutionNotifications)}.`
);
}
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Go: workaround for indirect tracing' name: 'PR Check - Go: workaround for indirect tracing'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,66 +19,63 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
go-indirect-tracing-workaround: go-indirect-tracing-workaround:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: default version: stable-v2.14.6
name: 'Go: workaround for indirect tracing' name: 'Go: workaround for indirect tracing'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with: with:
go-version: ${{ inputs.go-version || '>=1.21.0' }} # We need a Go version that ships with statically linked binaries on Linux
cache: false go-version: '>=1.21.0'
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: go languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: go build main.go run: go build main.go
- uses: ./../action/analyze - uses: ./../action/analyze
- run: | with:
upload-database: false
- shell: bash
run: |
if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then
echo "Expected the workaround for indirect tracing of static binaries to trigger, but the" \ echo "Expected the workaround for indirect tracing of static binaries to trigger, but the" \
"CODEQL_ACTION_GO_BINARY environment variable is not set." "CODEQL_ACTION_GO_BINARY environment variable is not set."

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Go: tracing with autobuilder step' name: 'PR Check - Go: tracing with autobuilder step'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,99 +19,86 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
go-tracing-autobuilder: go-tracing-autobuilder:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.17.6 version: stable-20221211
- os: macos-latest - os: macos-latest
version: stable-v2.17.6 version: stable-20221211
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.18.4 version: stable-20230418
- os: macos-latest - os: macos-latest
version: stable-v2.18.4 version: stable-20230418
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.19.4 version: stable-v2.13.5
- os: macos-latest - os: macos-latest
version: stable-v2.19.4 version: stable-v2.13.5
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.20.7 version: stable-v2.14.6
- os: macos-latest - os: macos-latest
version: stable-v2.20.7 version: stable-v2.14.6
- os: ubuntu-latest
version: stable-v2.21.4
- os: macos-latest
version: stable-v2.21.4
- os: ubuntu-latest
version: stable-v2.22.4
- os: macos-latest
version: stable-v2.22.4
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest - os: macos-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest - os: macos-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest - os: macos-latest
version: nightly-latest version: nightly-latest
name: 'Go: tracing with autobuilder step' name: 'Go: tracing with autobuilder step'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with: with:
go-version: ${{ inputs.go-version || '>=1.21.0' }} go-version: ~1.21.1
cache: false
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: go languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/autobuild - uses: ./../action/autobuild
- uses: ./../action/analyze - uses: ./../action/analyze
- run: | with:
upload-database: false
- shell: bash
run: |
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
echo "Expected the Go autobuilder to be run, but the" \ echo "Expected the Go autobuilder to be run, but the" \
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true." "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true."

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Go: tracing with custom build steps' name: 'PR Check - Go: tracing with custom build steps'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,100 +19,88 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
go-tracing-custom-build-steps: go-tracing-custom-build-steps:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.17.6 version: stable-20221211
- os: macos-latest - os: macos-latest
version: stable-v2.17.6 version: stable-20221211
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.18.4 version: stable-20230418
- os: macos-latest - os: macos-latest
version: stable-v2.18.4 version: stable-20230418
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.19.4 version: stable-v2.13.5
- os: macos-latest - os: macos-latest
version: stable-v2.19.4 version: stable-v2.13.5
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.20.7 version: stable-v2.14.6
- os: macos-latest - os: macos-latest
version: stable-v2.20.7 version: stable-v2.14.6
- os: ubuntu-latest
version: stable-v2.21.4
- os: macos-latest
version: stable-v2.21.4
- os: ubuntu-latest
version: stable-v2.22.4
- os: macos-latest
version: stable-v2.22.4
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest - os: macos-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest - os: macos-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest - os: macos-latest
version: nightly-latest version: nightly-latest
name: 'Go: tracing with custom build steps' name: 'Go: tracing with custom build steps'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with: with:
go-version: ${{ inputs.go-version || '>=1.21.0' }} go-version: ~1.21.1
cache: false
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: go languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: go build main.go run: go build main.go
- uses: ./../action/analyze - uses: ./../action/analyze
- run: | with:
upload-database: false
- shell: bash
run: |
# Once we start running Bash 4.2 in all environments, we can replace the # Once we start running Bash 4.2 in all environments, we can replace the
# `! -z` flag with the more elegant `-v` which confirms that the variable # `! -z` flag with the more elegant `-v` which confirms that the variable
# is actually unset and not potentially set to a blank value. # is actually unset and not potentially set to a blank value.

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Go: tracing with legacy workflow' name: 'PR Check - Go: tracing with legacy workflow'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,98 +19,85 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
go-tracing-legacy-workflow: go-tracing-legacy-workflow:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.17.6 version: stable-20221211
- os: macos-latest - os: macos-latest
version: stable-v2.17.6 version: stable-20221211
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.18.4 version: stable-20230418
- os: macos-latest - os: macos-latest
version: stable-v2.18.4 version: stable-20230418
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.19.4 version: stable-v2.13.5
- os: macos-latest - os: macos-latest
version: stable-v2.19.4 version: stable-v2.13.5
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.20.7 version: stable-v2.14.6
- os: macos-latest - os: macos-latest
version: stable-v2.20.7 version: stable-v2.14.6
- os: ubuntu-latest
version: stable-v2.21.4
- os: macos-latest
version: stable-v2.21.4
- os: ubuntu-latest
version: stable-v2.22.4
- os: macos-latest
version: stable-v2.22.4
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest - os: macos-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest - os: macos-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest - os: macos-latest
version: nightly-latest version: nightly-latest
name: 'Go: tracing with legacy workflow' name: 'Go: tracing with legacy workflow'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with: with:
go-version: ${{ inputs.go-version || '>=1.21.0' }} go-version: ~1.21.1
cache: false
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: go languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze - uses: ./../action/analyze
- run: | with:
upload-database: false
- shell: bash
run: |
cd "$RUNNER_TEMP/codeql_databases" cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then if [[ ! -d go ]]; then
echo "Did not find a Go database" echo "Did not find a Go database"

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

@@ -1,80 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: Manual Check - go
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
jobs:
go-custom-queries:
name: 'Go: Custom queries'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-custom-queries.yml
with:
go-version: ${{ inputs.go-version }}
dotnet-version: ${{ inputs.dotnet-version }}
go-indirect-tracing-workaround-diagnostic:
name: 'Go: diagnostic when Go is changed after init step'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
with:
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround-no-file-program:
name: 'Go: diagnostic when `file` is not installed'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
with:
go-version: ${{ inputs.go-version }}
go-indirect-tracing-workaround:
name: 'Go: workaround for indirect tracing'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-indirect-tracing-workaround.yml
with:
go-version: ${{ inputs.go-version }}
go-tracing-autobuilder:
name: 'Go: tracing with autobuilder step'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-tracing-autobuilder.yml
with:
go-version: ${{ inputs.go-version }}
go-tracing-custom-build-steps:
name: 'Go: tracing with custom build steps'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-tracing-custom-build-steps.yml
with:
go-version: ${{ inputs.go-version }}
go-tracing-legacy-workflow:
name: 'Go: tracing with legacy workflow'
permissions:
contents: read
security-events: read
uses: ./.github/workflows/__go-tracing-legacy-workflow.yml
with:
go-version: ${{ inputs.go-version }}

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Packaging: Download using registries' name: 'PR Check - Packaging: Download using registries'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,32 +19,31 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
init-with-registries: init-with-registries:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: 'Packaging: Download using registries' name: 'Packaging: Download using registries'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
packages: read packages: read
@@ -51,15 +51,32 @@ jobs:
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Init with registries - name: Init with registries
uses: ./../action/init uses: ./../action/init
with: with:
@@ -73,6 +90,7 @@ jobs:
token: "${{ secrets.GITHUB_TOKEN }}" token: "${{ secrets.GITHUB_TOKEN }}"
- name: Verify packages installed - name: Verify packages installed
shell: bash
run: | run: |
PRIVATE_PACK="$HOME/.codeql/packages/codeql-testing/private-pack" PRIVATE_PACK="$HOME/.codeql/packages/codeql-testing/private-pack"
CODEQL_PACK1="$HOME/.codeql/packages/codeql-testing/codeql-pack1" CODEQL_PACK1="$HOME/.codeql/packages/codeql-testing/codeql-pack1"
@@ -94,6 +112,7 @@ jobs:
fi fi
- name: Verify qlconfig.yml file was created - name: Verify qlconfig.yml file was created
shell: bash
run: | run: |
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH" echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH"
@@ -106,6 +125,9 @@ jobs:
fi fi
- name: Verify contents of qlconfig.yml - name: Verify contents of qlconfig.yml
# yq is not available on windows
if: runner.os != 'Windows'
shell: bash
run: | run: |
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")' cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")'

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Custom source root name: PR Check - Custom source root
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,48 +19,53 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
javascript-source-root: javascript-source-root:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: Custom source root name: Custom source root
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Move codeql-action - name: Move codeql-action
shell: bash
run: | run: |
mkdir ../new-source-root mkdir ../new-source-root
mv * ../new-source-root mv * ../new-source-root
@@ -70,8 +76,11 @@ jobs:
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
upload-database: false
skip-queries: true skip-queries: true
upload: never
- name: Assert database exists - name: Assert database exists
shell: bash
run: | run: |
cd "$RUNNER_TEMP/codeql_databases" cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d javascript ]]; then if [[ ! -d javascript ]]; then

View File

@@ -1,83 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Job run UUID added to SARIF
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
job-run-uuid-sarif:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: nightly-latest
name: Job run UUID added to SARIF
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- uses: ./../action/init
id: init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
- name: Upload SARIF
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif
retention-days: 7
- name: Check results
run: |
cd "$RUNNER_TEMP/results"
actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif)
if [[ "$actual" != "$JOB_RUN_UUID" ]]; then
echo "Expected SARIF output to contain job run UUID '$JOB_RUN_UUID', but found '$actual'."
exit 1
else
echo "Found job run UUID '$actual'."
fi
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Language aliases name: PR Check - Language aliases
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,43 +19,47 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
language-aliases: language-aliases:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
name: Language aliases name: Language aliases
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: C#,java-kotlin,swift,typescript languages: C#,java-kotlin,swift,typescript

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

@@ -1,115 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Local CodeQL bundle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
local-bundle:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
name: Local CodeQL bundle
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Fetch latest CodeQL bundle
run: |
wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.zst
- id: init
uses: ./../action/init
with:
# Swift is not supported on Ubuntu so we manually exclude it from the list here
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ./codeql-bundle-linux64.tar.zst
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Multi-language repository name: PR Check - Multi-language repository
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,134 +19,85 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
multi-language-autodetect: multi-language-autodetect:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: macos-latest
version: stable-v2.17.6
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.17.6 version: stable-20221211
- os: macos-latest - os: macos-latest
version: stable-v2.18.4 version: stable-20221211
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.18.4 version: stable-20230418
- os: macos-latest - os: macos-latest
version: stable-v2.19.4 version: stable-20230418
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.19.4 version: stable-v2.13.5
- os: macos-latest - os: macos-latest
version: stable-v2.20.7 version: stable-v2.13.5
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.20.7 version: stable-v2.14.6
- os: macos-latest - os: macos-latest
version: stable-v2.21.4 version: stable-v2.14.6
- os: ubuntu-latest
version: stable-v2.21.4
- os: macos-latest
version: stable-v2.22.4
- os: ubuntu-latest
version: stable-v2.22.4
- os: macos-latest
version: default
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest - os: macos-latest
version: linked version: default
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest - os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: ubuntu-latest - os: macos-latest
version: nightly-latest version: nightly-latest
name: Multi-language repository name: Multi-language repository
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Use Xcode 16
if: runner.os == 'macOS' && matrix.version != 'nightly-latest'
run: sudo xcode-select -s "/Applications/Xcode_16.app"
- uses: ./../action/init - uses: ./../action/init
id: init id: init
with: 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 }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
@@ -154,6 +106,7 @@ jobs:
upload-database: false upload-database: false
- name: Check language autodetect for all languages excluding Swift - name: Check language autodetect for all languages excluding Swift
shell: bash
run: | run: |
CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }} CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
@@ -191,8 +144,11 @@ jobs:
exit 1 exit 1
fi fi
- name: Check language autodetect for Swift on macOS - name: Check language autodetect for Swift
if: runner.os == 'macOS' if: >-
env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' ||
(runner.os != 'Windows' && matrix.version == 'nightly-latest')
shell: bash
run: | run: |
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
@@ -200,5 +156,4 @@ jobs:
exit 1 exit 1
fi fi
env: env:
CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true
CODEQL_ACTION_TEST_MODE: true CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,78 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Overlay database init fallback
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
overlay-init-fallback:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
- os: ubuntu-latest
version: nightly-latest
name: Overlay database init fallback
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- uses: ./../action/init
with:
languages: actions # Any language without overlay support will do
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
CODEQL_OVERLAY_DATABASE_MODE: overlay-base
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- name: Check database
run: |
cd "$RUNNER_TEMP/codeql_databases/actions"
if ! grep -q 'overlayBaseDatabase: false' codeql-database.yml ; then
echo "This test needs to be updated to use a non-overlay language."
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # 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: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,98 +19,63 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
packaging-codescanning-config-inputs-js: packaging-codescanning-config-inputs-js:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
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: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Check out repository - name: Setup Python on MacOS
uses: actions/checkout@v6 uses: actions/setup-python@v5
- name: Install Node.js if: >-
uses: actions/setup-node@v6 matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with: with:
node-version: 20.x python-version: '3.11'
cache: npm - name: Check out repository
- name: Install dependencies uses: actions/checkout@v4
run: npm ci
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
config-file: .github/codeql/codeql-config-packaging3.yml config-file: .github/codeql/codeql-config-packaging3.yml
@@ -117,6 +83,7 @@ jobs:
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
@@ -132,6 +99,7 @@ jobs:
queries-not-run: foo,bar queries-not-run: foo,bar
- name: Assert Results - name: Assert Results
shell: bash
run: | run: |
cd "$RUNNER_TEMP/results" cd "$RUNNER_TEMP/results"
# We should have 4 hits from these rules # We should have 4 hits from these rules

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Packaging: Config and input' name: 'PR Check - Packaging: Config and input'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,83 +19,63 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
packaging-config-inputs-js: packaging-config-inputs-js:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: 'Packaging: Config and input' name: 'Packaging: Config and input'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Check out repository - name: Setup Python on MacOS
uses: actions/checkout@v6 uses: actions/setup-python@v5
- name: Install Node.js if: >-
uses: actions/setup-node@v6 matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with: with:
node-version: 20.x python-version: '3.11'
cache: npm - name: Check out repository
- name: Install dependencies uses: actions/checkout@v4
run: npm ci
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
config-file: .github/codeql/codeql-config-packaging3.yml config-file: .github/codeql/codeql-config-packaging3.yml
@@ -102,6 +83,7 @@ jobs:
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
@@ -117,6 +99,7 @@ jobs:
queries-not-run: foo,bar queries-not-run: foo,bar
- name: Assert Results - name: Assert Results
shell: bash
run: | run: |
cd "$RUNNER_TEMP/results" cd "$RUNNER_TEMP/results"
# We should have 4 hits from these rules # We should have 4 hits from these rules

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Packaging: Config file' name: 'PR Check - Packaging: Config file'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,89 +19,70 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
packaging-config-js: packaging-config-js:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: 'Packaging: Config file' name: 'Packaging: Config file'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Check out repository - name: Setup Python on MacOS
uses: actions/checkout@v6 uses: actions/setup-python@v5
- name: Install Node.js if: >-
uses: actions/setup-node@v6 matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with: with:
node-version: 20.x python-version: '3.11'
cache: npm - name: Check out repository
- name: Install dependencies uses: actions/checkout@v4
run: npm ci
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
config-file: .github/codeql/codeql-config-packaging.yml config-file: .github/codeql/codeql-config-packaging.yml
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
@@ -116,6 +98,7 @@ jobs:
queries-not-run: foo,bar queries-not-run: foo,bar
- name: Assert Results - name: Assert Results
shell: bash
run: | run: |
cd "$RUNNER_TEMP/results" cd "$RUNNER_TEMP/results"
# We should have 4 hits from these rules # We should have 4 hits from these rules

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: 'PR Check - Packaging: Action input' name: 'PR Check - Packaging: Action input'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,83 +19,63 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
packaging-inputs-js: packaging-inputs-js:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: 'Packaging: Action input' name: 'Packaging: Action input'
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Check out repository - name: Setup Python on MacOS
uses: actions/checkout@v6 uses: actions/setup-python@v5
- name: Install Node.js if: >-
uses: actions/setup-node@v6 matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with: with:
node-version: 20.x python-version: '3.11'
cache: npm - name: Check out repository
- name: Install dependencies uses: actions/checkout@v4
run: npm ci
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
config-file: .github/codeql/codeql-config-packaging2.yml config-file: .github/codeql/codeql-config-packaging2.yml
@@ -102,6 +83,7 @@ jobs:
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2, codeql-testing/codeql-pack3:other-query.ql 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 }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
@@ -116,6 +98,7 @@ jobs:
queries-not-run: foo,bar queries-not-run: foo,bar
- name: Assert Results - name: Assert Results
shell: bash
run: | run: |
cd "$RUNNER_TEMP/results" cd "$RUNNER_TEMP/results"
# We should have 4 hits from these rules # We should have 4 hits from these rules

View File

@@ -1,148 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Quality queries input
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
quality-queries:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
analysis-kinds: code-scanning
- os: ubuntu-latest
version: linked
analysis-kinds: code-quality
- os: ubuntu-latest
version: linked
analysis-kinds: code-scanning,code-quality
- os: ubuntu-latest
version: nightly-latest
analysis-kinds: code-scanning
- os: ubuntu-latest
version: nightly-latest
analysis-kinds: code-quality
- os: ubuntu-latest
version: nightly-latest
analysis-kinds: code-scanning,code-quality
name: Quality queries input
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- uses: ./../action/init
with:
languages: javascript
analysis-kinds: ${{ matrix.analysis-kinds }}
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
post-processed-sarif-path: ${{ runner.temp }}/post-processed
- name: Upload security SARIF
if: contains(matrix.analysis-kinds, 'code-scanning')
uses: actions/upload-artifact@v5
with:
name: |
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif
retention-days: 7
- name: Upload quality SARIF
if: contains(matrix.analysis-kinds, 'code-quality')
uses: actions/upload-artifact@v5
with:
name: |
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.quality.sarif.json
path: ${{ runner.temp }}/results/javascript.quality.sarif
retention-days: 7
- name: Upload post-processed SARIF
uses: actions/upload-artifact@v5
with:
name: |
post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json
path: ${{ runner.temp }}/post-processed
retention-days: 7
if-no-files-found: error
- name: Check quality query does not appear in security SARIF
if: contains(matrix.analysis-kinds, 'code-scanning')
uses: actions/github-script@v8
env:
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@v8
env:
SARIF_PATH: ${{ runner.temp }}/results/javascript.quality.sarif
EXPECT_PRESENT: 'true'
with:
script: ${{ env.CHECK_SCRIPT }}
env:
CHECK_SCRIPT: |
const fs = require('fs');
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
const expectPresent = JSON.parse(process.env['EXPECT_PRESENT']);
const run = sarif.runs[0];
const extensions = run.tool.extensions;
if (extensions === undefined) {
core.setFailed('`extensions` property not found in the SARIF run property bag.');
}
// ID of a query we want to check the presence for
const targetId = 'js/regex/always-matches';
const found = extensions.find(extension => extension.rules && extension.rules.find(rule => rule.id === targetId));
if (found && expectPresent) {
console.log(`Found rule with id '${targetId}'.`);
} else if (!found && !expectPresent) {
console.log(`Rule with id '${targetId}' was not found.`);
} else {
core.setFailed(`${ found ? "Found" : "Didn't find" } rule ${targetId}`);
}
CODEQL_ACTION_TEST_MODE: true

126
.github/workflows/__remote-config.yml generated vendored
View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Remote config file name: PR Check - Remote config file
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,89 +19,87 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
remote-config: remote-config:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: stable-20230418
- os: macos-latest
version: stable-20230418
- os: windows-latest
version: stable-20230418
- os: ubuntu-latest
version: stable-v2.13.5
- os: macos-latest
version: stable-v2.13.5
- os: windows-latest
version: stable-v2.13.5
- os: ubuntu-latest
version: stable-v2.14.6
- os: macos-latest
version: stable-v2.14.6
- os: windows-latest
version: stable-v2.14.6
- os: ubuntu-latest
version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: Remote config file name: Remote config file
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -108,6 +107,7 @@ jobs:
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
github.sha }} github.sha }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
env: env:

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Resolve environment name: PR Check - Resolve environment
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,50 +19,73 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
resolve-environment-action: resolve-environment-action:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: stable-v2.13.4
- os: macos-latest
version: stable-v2.13.4
- os: windows-latest
version: stable-v2.13.4
- os: ubuntu-latest
version: default
- os: macos-latest
version: default
- os: windows-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: Resolve environment name: Resolve environment
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: go,javascript-typescript languages: ${{ matrix.version == 'stable-v2.13.4' && 'go' || 'go,javascript-typescript'
}}
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Resolve environment for Go - name: Resolve environment for Go
@@ -75,13 +99,14 @@ jobs:
run: exit 1 run: exit 1
- name: Resolve environment for JavaScript/TypeScript - name: Resolve environment for JavaScript/TypeScript
if: matrix.version != 'stable-v2.13.4'
uses: ./../action/resolve-environment uses: ./../action/resolve-environment
id: resolve-environment-js id: resolve-environment-js
with: with:
language: javascript-typescript language: javascript-typescript
- name: Fail if JavaScript/TypeScript configuration present - name: Fail if JavaScript/TypeScript configuration present
if: if: matrix.version != 'stable-v2.13.4' &&
fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript
run: exit 1 run: exit 1
env: env:

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - RuboCop multi-language name: PR Check - RuboCop multi-language
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,52 +19,59 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
rubocop-multi-language: rubocop-multi-language:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
name: RuboCop multi-language name: RuboCop multi-language
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Set up Ruby - name: Set up Ruby
uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 2.6 ruby-version: 2.6
- name: Install Code Scanning integration - name: Install Code Scanning integration
shell: bash
run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install
- name: Install dependencies - name: Install dependencies
shell: bash
run: bundle install run: bundle install
- name: RuboCop run - name: RuboCop run
shell: bash
run: | run: |
bash -c " bash -c "
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif

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

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Ruby analysis name: PR Check - Ruby analysis
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,28 +19,16 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
ruby: ruby:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest - os: macos-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest - os: macos-latest
@@ -49,22 +38,38 @@ jobs:
- os: macos-latest - os: macos-latest
version: nightly-latest version: nightly-latest
name: Ruby analysis name: Ruby analysis
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init - uses: ./../action/init
with: with:
languages: ruby languages: ruby
@@ -74,6 +79,7 @@ jobs:
with: with:
upload-database: false upload-database: false
- name: Check database - name: Check database
shell: bash
run: | run: |
RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}" RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}"
if [[ ! -d "$RUBY_DB" ]]; then if [[ ! -d "$RUBY_DB" ]]; then

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

@@ -1,82 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Rust analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
rust:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: stable-v2.19.3
- os: ubuntu-latest
version: stable-v2.22.1
- os: ubuntu-latest
version: linked
- os: ubuntu-latest
version: default
- os: ubuntu-latest
version: nightly-latest
name: Rust analysis
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- uses: ./../action/init
with:
languages: rust
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- name: Check database
run: |
RUST_DB="${{ fromJson(steps.analysis.outputs.db-locations).rust }}"
if [[ ! -d "$RUST_DB" ]]; then
echo "Did not create a database for Rust."
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

109
.github/workflows/__scaling-reserved-ram.yml generated vendored Normal file
View File

@@ -0,0 +1,109 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file.
name: PR Check - Scaling reserved RAM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
scaling-reserved-ram:
strategy:
matrix:
include:
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: ubuntu-latest
version: stable-20230418
- os: macos-latest
version: stable-20230418
- os: ubuntu-latest
version: stable-v2.13.5
- os: macos-latest
version: stable-v2.13.5
- os: ubuntu-latest
version: stable-v2.14.6
- os: macos-latest
version: stable-v2.14.6
- os: ubuntu-latest
version: default
- os: macos-latest
version: default
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: Scaling reserved RAM
permissions:
contents: read
security-events: write
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository
uses: actions/checkout@v4
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
- name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
id: init
with:
db-location: ${{ runner.temp }}/customDbLocation
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
env:
CODEQL_ACTION_SCALING_RESERVED_RAM: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Split workflow name: PR Check - Split workflow
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,48 +19,16 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
split-workflow: split-workflow:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest - os: macos-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest - os: macos-latest
@@ -69,31 +38,38 @@ jobs:
- os: macos-latest - os: macos-latest
version: nightly-latest version: nightly-latest
name: Split workflow name: Split workflow
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
config-file: .github/codeql/codeql-config-packaging3.yml config-file: .github/codeql/codeql-config-packaging3.yml
@@ -101,6 +77,7 @@ jobs:
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
@@ -109,6 +86,7 @@ jobs:
upload-database: false upload-database: false
- name: Assert No Results - name: Assert No Results
shell: bash
run: | run: |
if [ "$(ls -A $RUNNER_TEMP/results)" ]; then if [ "$(ls -A $RUNNER_TEMP/results)" ]; then
echo "Expected results directory to be empty after skipping query execution!" echo "Expected results directory to be empty after skipping query execution!"
@@ -119,6 +97,7 @@ jobs:
output: ${{ runner.temp }}/results output: ${{ runner.temp }}/results
upload-database: false upload-database: false
- name: Assert Results - name: Assert Results
shell: bash
run: | run: |
cd "$RUNNER_TEMP/results" cd "$RUNNER_TEMP/results"
# We should have 4 hits from these rules # We should have 4 hits from these rules

85
.github/workflows/__start-proxy.yml generated vendored
View File

@@ -1,85 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Start proxy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
start-proxy:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: linked
- os: macos-latest
version: linked
- os: windows-latest
version: linked
name: Start proxy
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- uses: ./../action/init
with:
languages: csharp
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Setup proxy for registries
id: proxy
uses: ./../action/start-proxy
with:
registry_secrets: '[{ "type": "nuget_feed", "url": "https://api.nuget.org/v3/index.json"
}]'
- name: Print proxy outputs
run: |
echo "${{ steps.proxy.outputs.proxy_host }}"
echo "${{ steps.proxy.outputs.proxy_port }}"
echo "${{ steps.proxy.outputs.proxy_urls }}"
- name: Fail if proxy outputs are not set
if: (!steps.proxy.outputs.proxy_host) || (!steps.proxy.outputs.proxy_port)
|| (!steps.proxy.outputs.proxy_ca_certificate) || (!steps.proxy.outputs.proxy_urls)
run: exit 1
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Submit SARIF after failure name: PR Check - Submit SARIF after failure
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,53 +19,55 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
submit-sarif-failure: submit-sarif-failure:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: Submit SARIF after failure name: Submit SARIF after failure
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: write # needed to upload the SARIF file security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- uses: actions/checkout@v6 if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: ./init - uses: ./init
with: with:
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Fail - name: Fail
# We want this job to pass if the Action correctly uploads the SARIF file for # We want this job to pass if the Action correctly uploads the SARIF file for
# the failed run. # the failed run.

View File

@@ -1,80 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Swift analysis using autobuild
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
swift-autobuild:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
version: nightly-latest
name: Swift analysis using autobuild
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- uses: ./../action/init
id: init
with:
languages: swift
build-mode: autobuild
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check working directory
run: pwd
- uses: ./../action/autobuild
timeout-minutes: 30
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- name: Check database
run: |
SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
if [[ ! -d "$SWIFT_DB" ]]; then
echo "Did not create a database for Swift."
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Swift analysis using a custom build command name: PR Check - Swift analysis using a custom build command
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,93 +19,77 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
swift-custom-build: swift-custom-build:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest
version: latest
- os: macos-latest - os: macos-latest
version: linked version: latest
- os: ubuntu-latest
version: default
- os: macos-latest - os: macos-latest
version: default version: default
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest - os: macos-latest
version: nightly-latest version: nightly-latest
name: Swift analysis using a custom build command name: Swift analysis using a custom build command
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Use Xcode 16
if: runner.os == 'macOS' && matrix.version != 'nightly-latest'
run: sudo xcode-select -s "/Applications/Xcode_16.app"
- uses: ./../action/init - uses: ./../action/init
id: init id: init
with: with:
languages: swift languages: swift
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{steps.init.outputs.codeql-path}}
- name: Check working directory - name: Check working directory
shell: bash
run: pwd run: pwd
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
id: analysis id: analysis
with: with:
upload-database: false upload-database: false
- name: Check database - name: Check database
shell: bash
run: | run: |
SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}" SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
if [[ ! -d "$SWIFT_DB" ]]; then if [[ ! -d "$SWIFT_DB" ]]; then

89
.github/workflows/__test-autobuild-working-dir.yml generated vendored Normal file
View File

@@ -0,0 +1,89 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file.
name: PR Check - Autobuild working directory
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
test-autobuild-working-dir:
strategy:
matrix:
include:
- os: ubuntu-latest
version: latest
name: Autobuild working directory
permissions:
contents: read
security-events: write
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository
uses: actions/checkout@v4
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
- name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Test setup
shell: bash
run: |
# Make sure that Gradle build succeeds in autobuild-dir ...
cp -a ../action/tests/java-repo autobuild-dir
# ... and fails if attempted in the current directory
echo > build.gradle
- uses: ./../action/init
with:
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/autobuild
with:
working-directory: autobuild-dir
- uses: ./../action/analyze
with:
upload-database: false
- name: Check database
shell: bash
run: |
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d java ]]; then
echo "Did not find a Java database"
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

83
.github/workflows/__test-local-codeql.yml generated vendored Normal file
View File

@@ -0,0 +1,83 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file.
name: PR Check - Local CodeQL bundle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
test-local-codeql:
strategy:
matrix:
include:
- os: ubuntu-latest
version: nightly-latest
name: Local CodeQL bundle
permissions:
contents: read
security-events: write
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository
uses: actions/checkout@v4
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
- name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Fetch a CodeQL bundle
shell: bash
env:
CODEQL_URL: ${{ steps.prepare-test.outputs.tools-url }}
run: |
wget "$CODEQL_URL"
- id: init
uses: ./../action/init
with:
tools: ./codeql-bundle-linux64.tar.gz
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
env:
CODEQL_ACTION_TEST_MODE: true

80
.github/workflows/__test-proxy.yml generated vendored Normal file
View File

@@ -0,0 +1,80 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file.
name: PR Check - Proxy test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
test-proxy:
strategy:
matrix:
include:
- os: ubuntu-latest
version: latest
name: Proxy test
permissions:
contents: read
security-events: write
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository
uses: actions/checkout@v4
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
- name: Set environment variable for Swift enablement
if: runner.os != 'Windows' && matrix.version == '20221211'
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
upload-database: false
env:
https_proxy: http://squid-proxy:3128
CODEQL_ACTION_TEST_MODE: true
container:
image: ubuntu:22.04
options: --dns 127.0.0.1
services:
squid-proxy:
image: ubuntu/squid:latest
ports:
- 3128:3128

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Test unsetting environment variables name: PR Check - Test unsetting environment variables
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,103 +19,79 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
unset-environment: unset-environment:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: stable-20221211
- os: ubuntu-latest
version: stable-20230418
- os: ubuntu-latest
version: stable-v2.13.5
- os: ubuntu-latest
version: stable-v2.14.6
- os: ubuntu-latest
version: default
- os: ubuntu-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
name: Test unsetting environment variables name: Test unsetting environment variables
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
id: init id: init
with: with:
db-location: ${{ runner.temp }}/customDbLocation db-location: ${{ runner.temp }}/customDbLocation
# Swift is not supported on Ubuntu so we manually exclude it from the list here
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code - name: Build code
run: env -i PATH="$PATH" HOME="$HOME" ./build.sh shell: bash
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
# workaround for our PR checks.
run: env -i CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN=true PATH="$PATH" HOME="$HOME"
./build.sh
- uses: ./../action/analyze - uses: ./../action/analyze
id: analysis id: analysis
with: with:
upload-database: false upload-database: false
- run: | - shell: bash
run: |
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}" CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then
echo "::error::Did not create a database for CPP, or created it in the wrong location." \ echo "::error::Did not create a database for CPP, or created it in the wrong location." \

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: "PR Check - Upload-sarif: 'ref' and 'sha' from inputs" name: "PR Check - Upload-sarif: 'ref' and 'sha' from inputs"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,87 +19,51 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
upload-ref-sha-input: upload-ref-sha-input:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: windows-latest
version: default
name: "Upload-sarif: 'ref' and 'sha' from inputs" name: "Upload-sarif: 'ref' and 'sha' from inputs"
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init - uses: ./../action/init
with: with:
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
@@ -106,10 +71,11 @@ jobs:
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
github.sha }} github.sha }}
- name: Build code - name: Build code
shell: bash
run: ./build.sh run: ./build.sh
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze - uses: ./../action/analyze
with: with:
upload-database: false
ref: refs/heads/main ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2 sha: 5e235361806c361d4d3f8859e3c897658025a9a2
upload: never upload: never

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

@@ -1,187 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Test different uses of `upload-sarif`
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
upload-sarif:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: default
analysis-kinds: code-scanning
- os: ubuntu-latest
version: default
analysis-kinds: code-quality
- os: ubuntu-latest
version: default
analysis-kinds: code-scanning,code-quality
name: Test different uses of `upload-sarif`
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: csharp,java,javascript,python
analysis-kinds: ${{ matrix.analysis-kinds }}
- name: Build code
run: ./build.sh
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
upload: never
output: ${{ runner.temp }}/results
- name: |
Upload all SARIF files for `analysis-kinds: ${{ matrix.analysis-kinds }}`
uses: ./../action/upload-sarif
id: upload-sarif
with:
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`
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`
if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)
run: exit 1
- name: Upload single SARIF file for Code Scanning
uses: ./../action/upload-sarif
id: upload-single-sarif-code-scanning
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
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
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
uses: ./../action/upload-sarif
id: upload-single-sarif-code-quality
if: contains(matrix.analysis-kinds, 'code-quality')
with:
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
if: contains(matrix.analysis-kinds, 'code-quality') &&
!(fromJSON(steps.upload-single-sarif-code-quality.outputs.sarif-ids).code-quality)
run: exit 1
- name: Change SARIF file extension
if: contains(matrix.analysis-kinds, 'code-scanning')
run: mv ${{ runner.temp }}/results/javascript.sarif ${{ runner.temp }}/results/javascript.sarif.json
- name: Upload single non-`.sarif` file
uses: ./../action/upload-sarif
id: upload-single-non-sarif
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
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
if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-non-sarif.outputs.sarif-ids).code-scanning)
run: exit 1
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,12 +1,13 @@
# Warning: This file is generated automatically, and should not be modified. # Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run: # Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh # (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
# to regenerate this file. # to regenerate this file.
name: PR Check - Use a custom `checkout_path` name: PR Check - Use a custom `checkout_path`
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on: on:
push: push:
branches: branches:
@@ -18,88 +19,53 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule: workflow_dispatch: {}
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
dotnet-version:
type: string
description: The version of .NET to install
required: false
default: 9.x
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs: jobs:
with-checkout-path: with-checkout-path:
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
name: Use a custom `checkout_path` name: Use a custom `checkout_path`
if: github.triggering_actor != 'dependabot[bot]'
permissions: permissions:
contents: read contents: read
security-events: read security-events: write
timeout-minutes: 45 timeout-minutes: 45
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup Python on MacOS
uses: actions/setup-python@v5
if: >-
matrix.os == 'macos-latest' && (
matrix.version == 'stable-20221211' ||
matrix.version == 'stable-20230418' ||
matrix.version == 'stable-v2.13.5' ||
matrix.version == 'stable-v2.14.6')
with:
python-version: '3.11'
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
use-all-platform-bundle: 'false' use-all-platform-bundle: 'false'
setup-kotlin: 'true' - name: Set environment variable for Swift enablement
- name: Install Go if: runner.os != 'Windows' && matrix.version == '20221211'
uses: actions/setup-go@v6 shell: bash
with: run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Delete original checkout - name: Delete original checkout
shell: bash
run: | run: |
# delete the original checkout so we don't accidentally use it. # delete the original checkout so we don't accidentally use it.
# Actions does not support deleting the current working directory, so we # Actions does not support deleting the current working directory, so we
@@ -107,7 +73,7 @@ jobs:
rm -rf ./* .github .git rm -rf ./* .github .git
# Check out the actions repo again, but at a different location. # Check out the actions repo again, but at a different location.
# choose an arbitrary SHA so that we can later test that the commit_oid is not from main # choose an arbitrary SHA so that we can later test that the commit_oid is not from main
- uses: actions/checkout@v6 - uses: actions/checkout@v4
with: with:
ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
path: x/y/z/some-path path: x/y/z/some-path
@@ -120,6 +86,7 @@ jobs:
source-root: x/y/z/some-path/tests/multi-language-repo source-root: x/y/z/some-path/tests/multi-language-repo
- name: Build code - name: Build code
shell: bash
working-directory: x/y/z/some-path/tests/multi-language-repo working-directory: x/y/z/some-path/tests/multi-language-repo
run: | run: |
./build.sh ./build.sh
@@ -129,33 +96,41 @@ jobs:
checkout_path: x/y/z/some-path/tests/multi-language-repo checkout_path: x/y/z/some-path/tests/multi-language-repo
ref: v1.1.0 ref: v1.1.0
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
upload: never
upload-database: false
- uses: ./../action/upload-sarif
with:
ref: v1.1.0
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
checkout_path: x/y/z/some-path/tests/multi-language-repo
- name: Verify SARIF after upload - name: Verify SARIF after upload
shell: bash
run: | run: |
PAYLOAD_FILE="$RUNNER_TEMP/payload-code-scanning.json"
EXPECTED_COMMIT_OID="474bbf07f9247ffe1856c6a0f94aeeb10e7afee6" EXPECTED_COMMIT_OID="474bbf07f9247ffe1856c6a0f94aeeb10e7afee6"
EXPECTED_REF="v1.1.0" EXPECTED_REF="v1.1.0"
EXPECTED_CHECKOUT_URI_SUFFIX="/x/y/z/some-path/tests/multi-language-repo" EXPECTED_CHECKOUT_URI_SUFFIX="/x/y/z/some-path/tests/multi-language-repo"
ACTUAL_COMMIT_OID="$(cat "$PAYLOAD_FILE" | jq -r .commit_oid)" ACTUAL_COMMIT_OID="$(cat "$RUNNER_TEMP/payload.json" | jq -r .commit_oid)"
ACTUAL_REF="$(cat "$PAYLOAD_FILE" | jq -r .ref)" ACTUAL_REF="$(cat "$RUNNER_TEMP/payload.json" | jq -r .ref)"
ACTUAL_CHECKOUT_URI="$(cat "$PAYLOAD_FILE" | jq -r .checkout_uri)" ACTUAL_CHECKOUT_URI="$(cat "$RUNNER_TEMP/payload.json" | jq -r .checkout_uri)"
if [[ "$EXPECTED_COMMIT_OID" != "$ACTUAL_COMMIT_OID" ]]; then if [[ "$EXPECTED_COMMIT_OID" != "$ACTUAL_COMMIT_OID" ]]; then
echo "::error Invalid commit oid. Expected: $EXPECTED_COMMIT_OID Actual: $ACTUAL_COMMIT_OID" echo "::error Invalid commit oid. Expected: $EXPECTED_COMMIT_OID Actual: $ACTUAL_COMMIT_OID"
echo "$PAYLOAD_FILE" echo "$RUNNER_TEMP/payload.json"
exit 1 exit 1
fi fi
if [[ "$EXPECTED_REF" != "$ACTUAL_REF" ]]; then if [[ "$EXPECTED_REF" != "$ACTUAL_REF" ]]; then
echo "::error Invalid ref. Expected: '$EXPECTED_REF' Actual: '$ACTUAL_REF'" echo "::error Invalid ref. Expected: '$EXPECTED_REF' Actual: '$ACTUAL_REF'"
echo "$PAYLOAD_FILE" echo "$RUNNER_TEMP/payload.json"
exit 1 exit 1
fi fi
if [[ "$ACTUAL_CHECKOUT_URI" != *$EXPECTED_CHECKOUT_URI_SUFFIX ]]; then if [[ "$ACTUAL_CHECKOUT_URI" != *$EXPECTED_CHECKOUT_URI_SUFFIX ]]; then
echo "::error Invalid checkout URI suffix. Expected suffix: $EXPECTED_CHECKOUT_URI_SUFFIX Actual uri: $ACTUAL_CHECKOUT_URI" echo "::error Invalid checkout URI suffix. Expected suffix: $EXPECTED_CHECKOUT_URI_SUFFIX Actual uri: $ACTUAL_CHECKOUT_URI"
echo "$PAYLOAD_FILE" echo "$RUNNER_TEMP/payload.json"
exit 1 exit 1
fi fi
env: env:

View File

@@ -9,20 +9,13 @@ on:
# by other workflows. # by other workflows.
types: [opened, synchronize, reopened, ready_for_review] types: [opened, synchronize, reopened, ready_for_review]
defaults:
run:
shell: bash
jobs: jobs:
check-expected-release-files: check-expected-release-files:
runs-on: ubuntu-slim runs-on: ubuntu-latest
permissions:
contents: read
steps: steps:
- name: Checkout CodeQL Action - name: Checkout CodeQL Action
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Check Expected Release Files - name: Check Expected Release Files
run: | run: |
bundle_version="$(cat "./src/defaults.json" | jq -r ".bundleVersion")" bundle_version="$(cat "./src/defaults.json" | jq -r ".bundleVersion")"

View File

@@ -4,6 +4,7 @@ on:
push: push:
branches: [main, releases/v*] branches: [main, releases/v*]
pull_request: pull_request:
branches: [main, releases/v*]
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
# by other workflows. # by other workflows.
types: [opened, synchronize, reopened, ready_for_review] types: [opened, synchronize, reopened, ready_for_review]
@@ -12,26 +13,21 @@ on:
- cron: '30 1 * * 0' - cron: '30 1 * * 0'
workflow_dispatch: workflow_dispatch:
defaults:
run:
shell: bash
env: env:
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
jobs: jobs:
# Identify the CodeQL tool versions to use in the analysis job. # Identify the CodeQL tool versions to use in the analysis job.
check-codeql-versions: check-codeql-versions:
if: github.triggering_actor != 'dependabot[bot]'
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
versions: ${{ steps.compare.outputs.versions }} versions: ${{ steps.compare.outputs.versions }}
permissions: permissions:
contents: read security-events: write
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v4
- name: Init with default CodeQL bundle from the VM image - name: Init with default CodeQL bundle from the VM image
id: init-default id: init-default
uses: ./init uses: ./init
@@ -45,7 +41,7 @@ jobs:
id: init-latest id: init-latest
uses: ./init uses: ./init
with: with:
tools: linked tools: latest
languages: javascript languages: javascript
- name: Compare default and latest CodeQL bundle versions - name: Compare default and latest CodeQL bundle versions
id: compare id: compare
@@ -58,88 +54,45 @@ jobs:
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT" echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST" echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST"
# If we're running on a pull request, run with both bundles, even if `tools: linked` would # If we're running on a pull request, run with both bundles, even if `tools: latest` would
# be the same as `tools: null`. This allows us to make the job for each of the bundles a # be the same as `tools: null`. This allows us to make the job for each of the bundles a
# required status check. # required status check.
# #
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be # If we're running on push or schedule, then we can skip running with `tools: latest` when it would be
# the same as running with `tools: null`. # the same as running with `tools: null`.
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
VERSIONS_JSON='[null]' VERSIONS_JSON='[null]'
else else
VERSIONS_JSON='[null, "linked"]' VERSIONS_JSON='[null, "latest"]'
fi fi
# Output a JSON-encoded list with the distinct versions to test against. # Output a JSON-encoded list with the distinct versions to test against.
echo "Suggested matrix config for analysis job: $VERSIONS_JSON" echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT
analyze-javascript: build:
if: github.triggering_actor != 'dependabot[bot]'
needs: [check-codeql-versions] needs: [check-codeql-versions]
strategy: strategy:
fail-fast: false
matrix: matrix:
os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-14,macos-15] os: [ubuntu-20.04,ubuntu-22.04,windows-2019,windows-2022,macos-11,macos-12,macos-13]
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }} tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions: permissions:
contents: read
security-events: write security-events: write
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Initialize CodeQL - name: Initialize CodeQL
uses: ./init uses: ./init
id: init id: init
with: with:
languages: javascript languages: javascript
config-file: ./.github/codeql/codeql-config-javascript.yml config-file: ./.github/codeql/codeql-config.yml
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
# confirm steps.init.outputs.codeql-path points to the codeql binary # confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version - name: Print CodeQL Version
run: > run: ${{steps.init.outputs.codeql-path}} version --format=json
"$CODEQL" version --format=json
env:
CODEQL: ${{steps.init.outputs.codeql-path}}
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: ./analyze uses: ./analyze
with:
category: "/language:javascript"
upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && 'always') || 'never' }}
analyze-other:
if: github.triggering_actor != 'dependabot[bot]'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- language: actions
- language: python
permissions:
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v6
- 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 }}"

View File

@@ -3,9 +3,6 @@
name: Code-Scanning config CLI tests name: Code-Scanning config CLI tests
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Diff informed queries add an additional query filter which is not yet
# taken into account by these tests.
CODEQL_ACTION_DIFF_INFORMED_QUERIES: false
on: on:
push: push:
@@ -18,34 +15,27 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
defaults:
run:
shell: bash
jobs: jobs:
code-scanning-config-tests: code-scanning-config-tests:
if: github.triggering_actor != 'dependabot[bot]'
continue-on-error: true continue-on-error: true
permissions:
contents: read
packages: read
security-events: read
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
version: linked version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest - os: ubuntu-latest
version: default version: default
- os: macos-latest
version: default
- os: ubuntu-latest - os: ubuntu-latest
version: nightly-latest version: nightly-latest
- os: macos-latest
version: nightly-latest
# Code-Scanning config not created because environment variable is not set # Code-Scanning config not created because environment variable is not set
name: Code Scanning Configuration tests name: Code Scanning Configuration tests
@@ -53,50 +43,20 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
# On PRs, overlay analysis may change the config that is passed to the CLI. - name: Empty file
# Therefore, we have two variants of the following test, one for PRs and one for other events.
- name: Empty file (non-PR)
if: github.event_name != 'pull_request'
uses: ./../action/.github/actions/check-codescanning-config uses: ./../action/.github/actions/check-codescanning-config
with: with:
expected-config-file-contents: "{}" expected-config-file-contents: "{}"
languages: javascript languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }} tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Empty file (PR)
if: github.event_name == 'pull_request'
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"query-filters": [
{
"exclude": {
"tags": "exclude-from-incremental"
}
}
]
}
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Packs from input - name: Packs from input
if: success() || failure() if: success() || failure()
uses: ./../action/.github/actions/check-codescanning-config uses: ./../action/.github/actions/check-codescanning-config
@@ -195,13 +155,13 @@ jobs:
with: with:
expected-config-file-contents: | expected-config-file-contents: |
{ {
"queries": [
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" },
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }
],
"packs": { "packs": {
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2", "codeql/javascript-queries" ] "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 languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql

View File

@@ -1,111 +0,0 @@
# Checks logs, SARIF, and database bundle debug artifacts exist
# when the analyze step fails.
name: PR Check - Debug artifacts after failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
defaults:
run:
shell: bash
jobs:
upload-artifacts:
if: github.triggering_actor != 'dependabot[bot]'
strategy:
fail-fast: false
matrix:
version:
- stable-v2.20.3
- default
- linked
- nightly-latest
name: Upload debug artifacts after failure in analyze
continue-on-error: true
env:
CODEQL_ACTION_TEST_MODE: true
permissions:
contents: read
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- name: Dump GitHub event
run: cat "${GITHUB_EVENT_PATH}"
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v6
with:
go-version: ^1.13.1
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.x'
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
debug: true
debug-artifact-name: my-debug-artifacts
debug-database-name: my-db
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
id: analysis
env:
# Forces a failure in this step.
CODEQL_ACTION_EXTRA_OPTIONS: '{ "database": { "finalize": ["--invalid-option"] } }'
with:
expect-error: true
download-and-check-artifacts:
name: Download and check debug artifacts after failure in analyze
if: github.triggering_actor != 'dependabot[bot]'
needs: upload-artifacts
timeout-minutes: 45
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v6
- name: Check expected artifacts exist
run: |
LANGUAGES="cpp csharp go java javascript python"
for version in $VERSIONS; do
echo "Artifacts from version $version:"
pushd "./my-debug-artifacts-${version//./}"
for language in $LANGUAGES; do
echo "- Checking $language"
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
echo "Missing a partial database bundle for $language"
exit 1
fi
if [[ ! -d "log" ]] ; then
echo "Missing database initialization logs"
exit 1
fi
if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then
echo "Missing logs for $language"
exit 1
fi
done
popd
done
env:
GO111MODULE: auto

View File

@@ -0,0 +1,86 @@
# Checks logs, SARIF, and database bundle debug artifacts exist
# when the analyze step fails.
name: PR Check - Debug artifacts after failure
env:
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
# workaround for our PR checks.
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
upload-artifacts:
name: Upload debug artifacts after failure in analyze
continue-on-error: true
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- name: Dump GitHub event
run: cat "${GITHUB_EVENT_PATH}"
- name: Check out repository
uses: actions/checkout@v4
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: latest
- uses: actions/setup-go@v5
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
debug: true
debug-artifact-name: my-debug-artifacts
debug-database-name: my-db
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
id: analysis
with:
expect-error: true
ram: 1
download-and-check-artifacts:
name: Download and check debug artifacts after failure in analyze
needs: upload-artifacts
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Check expected artifacts exist
shell: bash
run: |
LANGUAGES="cpp csharp go java javascript python"
cd "./my-debug-artifacts"
echo "Artifacts from run:"
for language in $LANGUAGES; do
echo "- Checking $language"
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
echo "Missing a partial database bundle for $language"
exit 1
fi
if [[ ! -d "log" ]] ; then
echo "Missing database initialization logs"
exit 1
fi
if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then
echo "Missing logs for $language"
exit 1
fi
done
env:
GO111MODULE: auto

View File

@@ -1,106 +0,0 @@
# Checks logs, SARIF, and database bundle debug artifacts exist.
name: PR Check - Debug artifact upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
defaults:
run:
shell: bash
jobs:
upload-artifacts:
if: github.triggering_actor != 'dependabot[bot]'
strategy:
fail-fast: false
matrix:
version:
- stable-v2.20.3
- default
- linked
- nightly-latest
name: Upload debug artifacts
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v6
with:
go-version: ^1.13.1
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.x'
- uses: ./../action/init
id: init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
debug: true
debug-artifact-name: my-debug-artifacts
debug-database-name: my-db
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
languages: cpp,csharp,go,java,javascript,python,ruby
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
id: analysis
download-and-check-artifacts:
name: Download and check debug artifacts
if: github.triggering_actor != 'dependabot[bot]'
needs: upload-artifacts
timeout-minutes: 45
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v6
- name: Check expected artifacts exist
run: |
VERSIONS="stable-v2.20.3 default linked nightly-latest"
LANGUAGES="cpp csharp go java javascript python"
for version in $VERSIONS; do
pushd "./my-debug-artifacts-${version//./}"
echo "Artifacts from version $version:"
for language in $LANGUAGES; do
echo "- Checking $language"
if [[ ! -f "$language.sarif" ]] ; then
echo "Missing a SARIF file for $language"
exit 1
fi
if [[ ! -f "my-db-$language.zip" ]] ; then
echo "Missing a database bundle for $language"
exit 1
fi
if [[ ! -d "$language/log" ]] ; then
echo "Missing logs for $language"
exit 1
fi
done
popd
done
env:
GO111MODULE: auto

97
.github/workflows/debug-artifacts.yml vendored Normal file
View File

@@ -0,0 +1,97 @@
# Checks logs, SARIF, and database bundle debug artifacts exist.
name: PR Check - Debug artifact upload
env:
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
# workaround for our PR checks.
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
upload-artifacts:
strategy:
matrix:
version:
- stable-20221211
- stable-20230418
- stable-v2.13.5
- stable-v2.14.6
- default
- latest
- nightly-latest
name: Upload debug artifacts
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v5
with:
go-version: ^1.13.1
- uses: ./../action/init
id: init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
debug: true
debug-artifact-name: my-debug-artifacts
debug-database-name: my-db
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
id: analysis
download-and-check-artifacts:
name: Download and check debug artifacts
needs: upload-artifacts
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Check expected artifacts exist
shell: bash
run: |
VERSIONS="stable-20221211 stable-20230418 stable-v2.13.5 stable-v2.14.6 default latest nightly-latest"
LANGUAGES="cpp csharp go java javascript python"
for version in $VERSIONS; do
pushd "./my-debug-artifacts-${version//./}"
echo "Artifacts from version $version:"
for language in $LANGUAGES; do
echo "- Checking $language"
if [[ ! -f "$language.sarif" ]] ; then
echo "Missing a SARIF file for $language"
exit 1
fi
if [[ ! -f "my-db-$language.zip" ]] ; then
echo "Missing a database bundle for $language"
exit 1
fi
if [[ ! -d "$language/log" ]] ; then
echo "Missing logs for $language"
exit 1
fi
done
popd
done
env:
GO111MODULE: auto

View File

@@ -0,0 +1,46 @@
name: Check queries that ran
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
expected-queries:
name: Expected Queries Tests
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: latest
- uses: ./../action/init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
upload: never
- name: Check Sarif
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/incomplete-hostname-regexp,js/path-injection
queries-not-run: foo,bar

View File

@@ -1,26 +0,0 @@
name: Label PR with size
on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited
- ready_for_review
permissions:
contents: read
pull-requests: write
jobs:
sizeup:
name: Label PR with size
runs-on: ubuntu-slim
steps:
- name: Run sizeup
uses: lerebear/sizeup-action@b7beb3dd273e36039e16e48e7bc690c189e61951 # 0.8.12
with:
token: "${{ secrets.GITHUB_TOKEN }}"
configuration-file-path: ".github/sizeup.yml"

View File

@@ -3,7 +3,7 @@
# tag # tag
# 2. Updates the `vN` tag to refer to this merge commit. # 2. Updates the `vN` tag to refer to this merge commit.
# 3. Iff vN == vLatest, merges any changes from the release back into the main branch. # 3. Iff vN == vLatest, merges any changes from the release back into the main branch.
# Typically, this is two commits one to update the version number and one to rebuild. # Typically, this is two commits one to update the version number and one to update dependencies.
name: Tag release and merge back name: Tag release and merge back
on: on:
@@ -18,23 +18,14 @@ on:
branches: branches:
- releases/v* - releases/v*
defaults:
run:
shell: bash
jobs: jobs:
merge-back: merge-back:
runs-on: ubuntu-slim runs-on: ubuntu-latest
environment: Automation
if: github.repository == 'github/codeql-action' if: github.repository == 'github/codeql-action'
env: env:
BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}" BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}"
HEAD_BRANCH: "${{ github.head_ref || github.ref }}" HEAD_BRANCH: "${{ github.head_ref || github.ref }}"
permissions:
contents: write # needed to create tags and push commits
pull-requests: write
steps: steps:
- name: Dump environment - name: Dump environment
run: env run: env
@@ -44,13 +35,10 @@ jobs:
GITHUB_CONTEXT: '${{ toJson(github) }}' GITHUB_CONTEXT: '${{ toJson(github) }}'
run: echo "${GITHUB_CONTEXT}" run: echo "${GITHUB_CONTEXT}"
- uses: actions/checkout@v6 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 # ensure we have all tags and can push commits fetch-depth: 0 # ensure we have all tags and can push commits
- uses: actions/setup-node@v6 - uses: actions/setup-node@v4
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Update git config - name: Update git config
run: | run: |
@@ -120,44 +108,45 @@ jobs:
# - `--force` since we're overwriting the `vN` tag # - `--force` since we're overwriting the `vN` tag
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}" git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}"
- name: Prepare partial Changelog - name: Create mergeback branch
env:
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
VERSION: "${{ steps.getVersion.outputs.version }}"
run: |
python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION" > $PARTIAL_CHANGELOG
echo "::group::Partial CHANGELOG"
cat $PARTIAL_CHANGELOG
echo "::endgroup::"
- name: Create mergeback branch and PR
if: ${{ steps.check.outputs.exists != 'true' && endsWith(github.ref_name, steps.getVersion.outputs.latest_release_branch) }} if: ${{ steps.check.outputs.exists != 'true' && endsWith(github.ref_name, steps.getVersion.outputs.latest_release_branch) }}
uses: ./.github/actions/prepare-mergeback-branch
with:
base: "${{ env.BASE_BRANCH }}"
head: "${{ env.HEAD_BRANCH }}"
branch: "${{ steps.getVersion.outputs.newBranch }}"
version: "${{ steps.getVersion.outputs.version }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Generate token
uses: actions/create-github-app-token@v2.2.0
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
- name: Create the GitHub release
if: steps.check.outputs.exists != 'true'
env: env:
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
VERSION: "${{ steps.getVersion.outputs.version }}" VERSION: "${{ steps.getVersion.outputs.version }}"
GH_TOKEN: ${{ steps.app-token.outputs.token }} NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: | run: |
# Do not mark this release as latest. The most recent CLI release must be marked as latest. set -exu
gh release create \ pr_title="Mergeback ${VERSION} ${HEAD_BRANCH} into ${BASE_BRANCH}"
"$VERSION" \ pr_body=$(cat << EOF
--latest=false \ This PR bumps the version number and updates the changelog after the ${VERSION} release.
--title "$VERSION" \
--notes-file "$PARTIAL_CHANGELOG" Please do the following:
- [ ] Remove and re-add the "Update dependencies" label to the PR to trigger just this workflow.
- [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.
- [ ] Mark the PR as ready for review to trigger the full set of PR checks.
- [ ] Approve and merge the PR. When merging the PR, make sure "Create a merge commit" is
selected rather than "Squash and merge" or "Rebase and merge".
EOF
)
# Update the version number ready for the next release
npm version patch --no-git-tag-version
# Update the changelog, adding a new version heading directly above the most recent existing one
awk '!f && /##/{print "'"## [UNRELEASED]\n\nNo user facing changes.\n"'"; f=1}1' CHANGELOG.md > temp && mv temp CHANGELOG.md
git add .
git commit -m "Update changelog and version after ${VERSION}"
git push origin "${NEW_BRANCH}"
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
gh pr create \
--head "${NEW_BRANCH}" \
--base "${BASE_BRANCH}" \
--title "${pr_title}" \
--label "Update dependencies" \
--body "${pr_body}" \
--assignee "${GITHUB_ACTOR}" \
--draft

View File

@@ -2,96 +2,118 @@ name: PR Checks
on: on:
push: push:
branches: [main, releases/v*]
pull_request: pull_request:
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
# by other workflows. # by other workflows.
types: [opened, synchronize, reopened, ready_for_review] types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: workflow_dispatch:
defaults:
run:
shell: bash
jobs: jobs:
unit-tests: check-js:
name: Unit Tests name: Check JS
if: github.triggering_actor != 'dependabot[bot]' runs-on: ubuntu-latest
timeout-minutes: 45
strategy: strategy:
fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] node-types-version: [16.11, current] # we backport this matrix job in order to maintain the same check names
node-version: [20, 24]
permissions: steps:
contents: read - name: Checkout
security-events: write # needed to upload ESLint results uses: actions/checkout@v4
runs-on: ${{ matrix.os }}
- name: Lint
run: npm run-script lint
- name: Update version of @types/node
if: matrix.node-types-version != 'current'
env:
NODE_TYPES_VERSION: ${{ matrix.node-types-version }}
run: |
# Export `NODE_TYPES_VERSION` so it's available to jq
export NODE_TYPES_VERSION="${NODE_TYPES_VERSION}"
contents=$(jq '.devDependencies."@types/node" = env.NODE_TYPES_VERSION' package.json)
echo "${contents}" > package.json
# Usually we run `npm install` on macOS to ensure that we pick up macOS-only dependencies.
# However we're not checking in the updated lockfile here, so it's fine to run
# `npm install` on Linux.
npm install
if [ ! -z "$(git status --porcelain)" ]; then
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"
# The period in `git add --all .` ensures that we stage deleted files too.
git add --all .
git commit -m "Use @types/node=${NODE_TYPES_VERSION}"
fi
- name: Check generated JS
if: matrix.node-types-version != 'current' # we do not need to test the newer node on the v2 branch
run: .github/workflows/script/check-js.sh
check-node-modules:
name: Check modules up to date
runs-on: macos-latest
timeout-minutes: 45 timeout-minutes: 45
steps: steps:
- name: Prepare git (Windows) - uses: actions/checkout@v4
if: runner.os == 'Windows' - name: Check node modules up to date
run: git config --global core.autocrlf false run: .github/workflows/script/check-node-modules.sh
- uses: actions/checkout@v6 check-file-contents:
name: Check file contents
runs-on: ubuntu-latest
timeout-minutes: 45
- name: Set up Node.js steps:
uses: actions/setup-node@v6 - name: Checkout
with: uses: actions/checkout@v4
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v5
with: with:
python-version: 3.11 python-version: 3.11
- name: Install dependencies - name: Install dependencies
run: | run: |
# Use the system Bash shell to ensure we can run commands like `npm ci` python -m pip install --upgrade pip
# that are not available in the default shell on Windows. # When updating this, update the autogenerated code header in `sync.py` too.
npm config set script-shell bash pip install ruamel.yaml==0.17.31
npm ci
- name: Verify compiled JS up to date
run: .github/workflows/script/check-js.sh
# Ensure the generated PR check workflows are up to date.
- name: Verify PR checks up to date - name: Verify PR checks up to date
if: always()
run: .github/workflows/script/verify-pr-checks.sh run: .github/workflows/script/verify-pr-checks.sh
- name: Run unit tests npm-test:
if: always() name: Unit Test
run: npm test needs: [check-js, check-node-modules]
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
- name: Run pr-checks tests steps:
if: always() - uses: actions/checkout@v4
working-directory: pr-checks - name: npm test
run: python -m unittest discover run: |
# Run any commands referenced in package.json using Bash, otherwise
- name: Lint # we won't be able to find them on Windows.
if: always() && matrix.os != 'windows-latest' npm config set script-shell bash
run: npm run lint-ci npm test
- name: Upload sarif
uses: github/codeql-action/upload-sarif@v4
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24
with:
sarif_file: eslint.sarif
category: eslint
check-node-version: check-node-version:
if: github.event.pull_request && github.triggering_actor != 'dependabot[bot]' if: ${{ github.event.pull_request }}
name: Check Action Node versions name: Check Action Node versions
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 45 timeout-minutes: 45
env: env:
BASE_REF: ${{ github.base_ref }} BASE_REF: ${{ github.base_ref }}
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v4
- id: head-version - id: head-version
name: Verify all Actions use the same Node version name: Verify all Actions use the same Node version
run: | run: |
@@ -106,7 +128,7 @@ jobs:
- id: checkout-base - id: checkout-base
name: 'Backport: Check out base ref' name: 'Backport: Check out base ref'
if: ${{ startsWith(github.head_ref, 'backport-') }} if: ${{ startsWith(github.head_ref, 'backport-') }}
uses: actions/checkout@v6 uses: actions/checkout@v4
with: with:
ref: ${{ env.BASE_REF }} ref: ${{ env.BASE_REF }}

View File

@@ -1,77 +0,0 @@
name: Prepare release
on:
workflow_call:
outputs:
version:
description: "The version that is being released."
value: ${{ jobs.prepare.outputs.version }}
major_version:
description: "The major version of the release."
value: ${{ jobs.prepare.outputs.major_version }}
latest_tag:
description: "The most recent, existing release tag."
value: ${{ jobs.prepare.outputs.latest_tag }}
backport_source_branch:
description: "The release branch for the given tag."
value: ${{ jobs.prepare.outputs.backport_source_branch }}
backport_target_branches:
description: "JSON encoded list of branches to target with backports."
value: ${{ jobs.prepare.outputs.backport_target_branches }}
push:
paths:
- .github/workflows/prepare-release.yml
defaults:
run:
shell: bash
jobs:
prepare:
name: "Prepare release"
runs-on: ubuntu-slim
if: github.repository == 'github/codeql-action'
permissions:
contents: read
outputs:
version: ${{ steps.versions.outputs.version }}
major_version: ${{ steps.versions.outputs.major_version }}
latest_tag: ${{ steps.versions.outputs.latest_tag }}
backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }}
backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0 # Need full history for calculation of diffs
- name: Configure runner for release
uses: ./.github/actions/release-initialise
- name: Get version tags
id: versions
run: |
VERSION="v$(jq '.version' -r 'package.json')"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
MAJOR_VERSION=$(cut -d '.' -f1 <<< "${VERSION}")
echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
echo "latest_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT
- name: Determine older release branches
id: branches
uses: ./.github/actions/release-branches
with:
major_version: ${{ steps.versions.outputs.major_version }}
latest_tag: ${{ steps.versions.outputs.latest_tag }}
- name: Print release information
run: |
echo 'version: ${{ steps.versions.outputs.version }}'
echo 'major_version: ${{ steps.versions.outputs.major_version }}'
echo 'latest_tag: ${{ steps.versions.outputs.latest_tag }}'
echo 'backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }}'
echo 'backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }}'

View File

@@ -1,27 +0,0 @@
name: 'Publish Immutable Action Version'
on:
push:
tags:
# Match version tags, but not the major version tags.
- 'v[0-9]+.**'
defaults:
run:
shell: bash
jobs:
publish:
runs-on: ubuntu-slim
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Publish immutable release
id: publish
uses: actions/publish-immutable-action@v0.0.4

174
.github/workflows/python-deps.yml vendored Normal file
View File

@@ -0,0 +1,174 @@
name: Test Python Package Installation
on:
push:
branches: [main, releases/v*]
pull_request:
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
# by other workflows.
types: [opened, synchronize, reopened, ready_for_review]
paths:
# Changes to this workflow.
- '.github/workflows/python-deps.yml'
# Changes to the Python package installation scripts and their tests.
- 'python-setup/**'
# Changes to the default CodeQL bundle version.
- '**/defaults.json'
schedule:
# Weekly on Monday.
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
test-setup-python-scripts:
timeout-minutes: 45
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]
python_deps_type: [pipenv, poetry, requirements, setup_py]
python_version: [3]
env:
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
PYTHON_VERSION: ${{ matrix.python_version }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: ./init
id: init
with:
tools: latest
languages: python
setup-python-dependencies: false
- name: Test Auto Package Installation
run: |
set -x
$GITHUB_WORKSPACE/python-setup/install_tools.sh
cd $GITHUB_WORKSPACE/python-setup/tests/${PYTHON_DEPS_TYPE}/requests-${PYTHON_VERSION}
case ${{ matrix.os }} in
ubuntu-20.04*) basePath="/opt";;
ubuntu-22.04*) basePath="/opt";;
macos-latest*) basePath="/Users/runner";;
esac
echo ${basePath}
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
- name: Setup for extractor
run: |
echo $CODEQL_PYTHON
# only run if $CODEQL_PYTHON is set
if [ ! -z $CODEQL_PYTHON ]; then
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
fi
- name: Verify packages installed
run: |
$GITHUB_WORKSPACE/python-setup/tests/check_requests.sh ${PYTHON_VERSION} 2.31.0
# This one shouldn't fail, but also won't install packages
test-setup-python-scripts-non-standard-location:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: ./init
id: init
with:
tools: latest
languages: python
setup-python-dependencies: false
- name: Test Auto Package Installation
run: |
set -x
$GITHUB_WORKSPACE/python-setup/install_tools.sh
cd $GITHUB_WORKSPACE/python-setup/tests/requirements/non-standard-location
case ${{ matrix.os }} in
ubuntu-20.04*) basePath="/opt";;
ubuntu-22.04*) basePath="/opt";;
macos-latest*) basePath="/Users/runner";;
esac
echo ${basePath}
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
- name: Setup for extractor
run: |
echo $CODEQL_PYTHON
# only run if $CODEQL_PYTHON is set
if [ ! -z $CODEQL_PYTHON ]; then
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
fi
- name: Verify packages installed
run: |
test -z $LGTM_INDEX_IMPORT_PATH
test-setup-python-scripts-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python_deps_type: [pipenv, poetry, requirements, setup_py]
python_version: [3]
env:
CODEQL_ACTION_TEST_MODE: true
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
PYTHON_VERSION: ${{ matrix.python_version }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Initialize CodeQL
id: init
uses: ./init
with:
tools: latest
languages: python
setup-python-dependencies: false
- name: Test Auto Package Installation
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: |
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
powershell -File $cmd
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/$Env:PYTHON_DEPS_TYPE/requests-$Env:PYTHON_VERSION
$codeql_dist = (get-item $Env:CODEQL_PATH).Directory.FullName
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py $codeql_dist
- name: Setup for extractor
run: |
echo $Env:CODEQL_PYTHON
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
- name: Verify packages installed
run: |
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests.ps1"
powershell -File $cmd $Env:PYTHON_VERSION 2.31.0

View File

@@ -12,26 +12,17 @@ on:
- cron: '0 0 * * 1' - cron: '0 0 * * 1'
workflow_dispatch: workflow_dispatch:
defaults:
run:
shell: bash
jobs: jobs:
test-setup-python-scripts: test-setup-python-scripts:
if: github.triggering_actor != 'dependabot[bot]'
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45 timeout-minutes: 45
permissions:
contents: read
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/setup-python@v6 - uses: actions/setup-python@v5
with: with:
python-version: 3.12 python-version: 3.12
- uses: actions/checkout@v6 - uses: actions/checkout@v4
- name: Prepare test - name: Prepare test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
@@ -41,8 +32,11 @@ jobs:
- name: Initialize CodeQL - name: Initialize CodeQL
uses: ./../action/init uses: ./../action/init
with: with:
tools: linked tools: latest
languages: python languages: python
- name: Analyze - name: Analyze
uses: ./../action/analyze uses: ./../action/analyze
with:
upload: false
upload-database: false

View File

@@ -11,40 +11,21 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
defaults:
run:
shell: bash
jobs: jobs:
query-filters: query-filters:
name: Query Filters Tests name: Query Filters Tests
if: github.triggering_actor != 'dependabot[bot]'
timeout-minutes: 45 timeout-minutes: 45
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read # This permission is needed to allow the GitHub Actions workflow to read the contents of the repository.
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v6 uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Prepare test - name: Prepare test
id: prepare-test id: prepare-test
uses: ./.github/actions/prepare-test uses: ./.github/actions/prepare-test
with: with:
version: linked version: latest
- name: Check SARIF for default queries with Single include, Single exclude - name: Check SARIF for default queries with Single include, Single exclude
uses: ./../action/.github/actions/query-filter-test uses: ./../action/.github/actions/query-filter-test

View File

@@ -3,34 +3,20 @@ name: Rebuild Action
on: on:
pull_request: pull_request:
types: [labeled] types: [labeled]
workflow_dispatch:
defaults:
run:
shell: bash
jobs: jobs:
rebuild: rebuild:
name: Rebuild Action name: Rebuild Action
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.label.name == 'Rebuild' || github.event_name == 'workflow_dispatch' if: github.event.label.name == 'Rebuild'
env:
HEAD_REF: ${{ github.event.pull_request.head.ref || github.event.ref }}
BASE_BRANCH: ${{ github.event.pull_request.base.ref || 'main' }}
permissions:
contents: write # needed to push rebuilt commit
pull-requests: write # needed to comment on the PR
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v4
with: with:
fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }}
ref: ${{ env.HEAD_REF }}
- name: Remove label - name: Remove label
if: github.event_name == 'pull_request'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
@@ -38,103 +24,54 @@ jobs:
gh pr edit --repo github/codeql-action "$PR_NUMBER" \ gh pr edit --repo github/codeql-action "$PR_NUMBER" \
--remove-label "Rebuild" --remove-label "Rebuild"
- name: Configure git
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Merge in changes from base branch - name: Merge in changes from base branch
id: merge env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
run: | run: |
git fetch origin "$BASE_BRANCH" git fetch origin "$BASE_BRANCH"
# Allow merge conflicts in `lib`, since rebuilding should resolve them. # Allow merge conflicts in `lib`, since rebuilding should resolve them.
git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected, continuing." git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected"
MERGE_RESULT=$?
if [ "$MERGE_RESULT" -ne 0 ]; then
echo "merge-in-progress=true" >> $GITHUB_OUTPUT
# Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check # Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check
# since `node_modules/@types/semver/README.md` fails it. # since `node_modules/@types/semver/README.md` fails it.
if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then
echo "Merge conflicts were detected outside of the lib directory. Please resolve them manually." echo "Merge conflicts detected outside of lib/ directory. Please resolve them manually."
git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true
exit 1 exit 1
fi fi
echo "No merge conflicts found outside the lib directory. We should be able to resolve all of" \
"these by rebuilding the Action."
fi
- name: Compile TypeScript - name: Compile TypeScript
run: | run: |
npm ci npm install
npm run lint -- --fix npm run lint -- --fix
npm run build npm run build
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v5
with: with:
python-version: 3.11 python-version: 3.11
- name: Sync back version updates to generated workflows
# Only sync back versions on Dependabot update PRs
if: startsWith(env.HEAD_REF, 'dependabot/')
working-directory: pr-checks
run: |
python3 sync_back.py -v
- name: Generate workflows - name: Generate workflows
working-directory: pr-checks
run: | run: |
cd pr-checks
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install ruamel.yaml==0.17.31 pip install ruamel.yaml==0.17.31
python3 sync.py python3 sync.py
- name: "Merge in progress: Finish merge and push" - name: Check for changes and push
if: steps.merge.outputs.merge-in-progress == 'true'
run: |
echo "Finishing merge and pushing changes."
git add --all
git commit --no-edit
git push
- name: "No merge in progress: Check for changes and push"
if: steps.merge.outputs.merge-in-progress != 'true'
id: push
run: |
if [ ! -z "$(git status --porcelain)" ]; then
echo "Changes detected, committing and pushing."
git add --all
# If the merge originally had conflicts, finish the merge.
# Otherwise, just commit the changes.
if git rev-parse --verify MERGE_HEAD >/dev/null 2>&1; then
echo "In progress merge detected, finishing it up."
git merge --continue
else
echo "No in-progress merge detected, committing changes."
git commit -m "Rebuild"
fi
echo "Pushing changes"
git push
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "No changes detected, nothing to commit."
fi
- name: Notify about rebuild
if: >-
github.event_name == 'pull_request' &&
(
steps.merge.outputs.merge-in-progress == 'true' ||
steps.push.outputs.changes == 'true'
)
env: env:
BRANCH: ${{ github.event.pull_request.head.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
run: | run: |
if [ ! -z "$(git status --porcelain)" ]; then
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "Rebuild"
git push origin "HEAD:$BRANCH"
echo "Pushed a commit to rebuild the Action." \ echo "Pushed a commit to rebuild the Action." \
"Please mark the PR as ready for review to trigger PR checks." | "Please mark the PR as ready for review to trigger PR checks." |
gh pr comment --body-file - --repo github/codeql-action "$PR_NUMBER" gh pr comment --body-file - --repo github/codeql-action "$PR_NUMBER"
gh pr ready --undo --repo github/codeql-action "$PR_NUMBER" gh pr ready --undo --repo github/codeql-action "$PR_NUMBER"
fi

View File

@@ -1,186 +0,0 @@
name: Rollback release
on:
# You can trigger this workflow via workflow dispatch to start a rollback.
# This will create a draft release that mirrors the release for `rollback-tag`.
workflow_dispatch:
inputs:
rollback-tag:
type: string
description: "The tag of an old release to roll-back to."
required: true
# Only for dry-runs of changes to the workflow.
push:
# Don't run dry-run on release branches, to avoid an issue where the
# "new" tag determined by the "Prepare release" job already exists.
branches-ignore:
- releases/v*
paths:
- .github/workflows/rollback-release.yml
- .github/actions/prepare-mergeback-branch/**
defaults:
run:
shell: bash
jobs:
prepare:
name: "Prepare release"
if: github.repository == 'github/codeql-action'
permissions:
contents: read
uses: ./.github/workflows/prepare-release.yml
rollback:
name: "Create rollback release"
if: github.repository == 'github/codeql-action'
runs-on: ubuntu-latest
timeout-minutes: 45
# Don't set the deployment environment for test runs
# The Actions token does not have permissions to push changes to workflow files.
# Since workflow files may change as part of a backport PR, we use the "Automation" environment for real runs to authenticate as a GitHub App and push these changes.
environment: ${{ github.event_name == 'workflow_dispatch' && 'Automation' || '' }}
needs:
- prepare
permissions:
contents: write # needed to push to the repo (tags and releases)
pull-requests: write # needed to create the mergeback PR
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0 # Need full history for calculation of diffs
- name: Configure runner for release
uses: ./.github/actions/release-initialise
- name: Create tag for testing
if: github.event_name != 'workflow_dispatch'
run: git tag v0.0.0
# We start by preparing the mergeback branch, mainly so that we have the updated changelog
# readily available for the partial changelog that's needed for the release.
- name: Prepare mergeback branch
id: mergeback-branch
env:
BASE_BRANCH: ${{ (github.event_name == 'workflow_dispatch' && 'main') || github.ref_name }}
VERSION: ${{ needs.prepare.outputs.version }}
run: |
set -x
# Checkout the base branch, since we may be testing on a different branch
git checkout "$BASE_BRANCH"
# Generate a new branch name for the mergeback PR
short_sha="${GITHUB_SHA:0:8}"
NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${short_sha}"
echo "new-branch=${NEW_BRANCH}" >> $GITHUB_OUTPUT
# Create the mergeback branch
git checkout -b "${NEW_BRANCH}"
- name: Prepare rollback changelog
env:
NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md"
# We usually expect to checkout `inputs.rollback-tag` (required for `workflow_dispatch`),
# but use `v0.0.0` for testing.
ROLLBACK_TAG: ${{ inputs.rollback-tag || 'v0.0.0' }}
LATEST_TAG: ${{ needs.prepare.outputs.latest_tag }}
VERSION: "${{ needs.prepare.outputs.version }}"
run: |
python .github/workflows/script/rollback_changelog.py \
--target-version "${ROLLBACK_TAG:1}" \
--rollback-version "${LATEST_TAG:1}" \
--new-version "$VERSION" > $NEW_CHANGELOG
echo "::group::New CHANGELOG"
cat $NEW_CHANGELOG
echo "::endgroup::"
- name: Create tags
env:
# We usually expect to checkout `inputs.rollback-tag` (required for `workflow_dispatch`),
# but use `v0.0.0` for testing.
ROLLBACK_TAG: ${{ inputs.rollback-tag || 'v0.0.0' }}
RELEASE_TAG: ${{ needs.prepare.outputs.version }}
MAJOR_VERSION_TAG: ${{ needs.prepare.outputs.major_version }}
run: |
git checkout "refs/tags/${ROLLBACK_TAG}"
git tag --annotate "${RELEASE_TAG}" --message "${RELEASE_TAG}"
git tag --annotate "${MAJOR_VERSION_TAG}" --message "${MAJOR_VERSION_TAG}" --force
- name: Push tags
# skip when testing
if: github.event_name == 'workflow_dispatch'
env:
RELEASE_TAG: ${{ needs.prepare.outputs.version }}
MAJOR_VERSION_TAG: ${{ needs.prepare.outputs.major_version }}
run: |
git push origin --atomic --force refs/tags/"${RELEASE_TAG}" refs/tags/"${MAJOR_VERSION_TAG}"
- name: Prepare partial Changelog
env:
NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md"
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
VERSION: "${{ needs.prepare.outputs.version }}"
run: |
python .github/workflows/script/prepare_changelog.py $NEW_CHANGELOG "$VERSION" > $PARTIAL_CHANGELOG
echo "::group::Partial CHANGELOG"
cat $PARTIAL_CHANGELOG
echo "::endgroup::"
- name: Generate token
if: github.event_name == 'workflow_dispatch'
uses: actions/create-github-app-token@v2.2.0
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
- name: Create the rollback release
if: github.event_name == 'workflow_dispatch'
env:
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
VERSION: "${{ needs.prepare.outputs.version }}"
GH_TOKEN: ${{ steps.app-token.outputs.token }}
RELEASE_URL: "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.version }}"
run: |
set -exu
# Do not mark this release as latest. The most recent bundle release must be marked as latest.
# Set as a draft to give us an opportunity to review the rollback release.
gh release create \
"$VERSION" \
--latest=false \
--draft \
--title "$VERSION" \
--notes-file "$PARTIAL_CHANGELOG"
echo "Created draft rollback release at $RELEASE_URL" >> $GITHUB_STEP_SUMMARY
- name: Update changelog
env:
NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md"
NEW_BRANCH: "${{ steps.mergeback-branch.outputs.new-branch }}"
run: |
git checkout "${NEW_BRANCH}"
mv ${NEW_CHANGELOG} CHANGELOG.md
- name: Create mergeback branch and PR
uses: ./.github/actions/prepare-mergeback-branch
with:
base: "main"
head: ""
branch: "${{ steps.mergeback-branch.outputs.new-branch }}"
version: "${{ needs.prepare.outputs.version }}"
token: "${{ secrets.GITHUB_TOKEN }}"
# Setting this to `true` for non-workflow_dispatch events will
# still push the `branch`, but won't create a corresponding PR
dry-run: "${{ github.event_name != 'workflow_dispatch' }}"

View File

@@ -1,18 +0,0 @@
import os
import re
# Get the PR number from the PR URL.
pr_number = os.environ['PR_URL'].split('/')[-1]
changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})"
# If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
with open('CHANGELOG.md', 'r') as f:
changelog = f.read()
changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n')
# Add the changelog note to the bottom of the "[UNRELEASED]" section.
changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1)
with open('CHANGELOG.md', 'w') as f:
f.write(changelog)

View File

@@ -7,7 +7,7 @@ if [ ! -z "$(git status --porcelain)" ]; then
>&2 echo "Failed: Repo should be clean before testing!" >&2 echo "Failed: Repo should be clean before testing!"
exit 1 exit 1
fi fi
# Wipe the lib directory in case there are extra unnecessary files in there # Wipe the lib directory incase there are extra unnecessary files in there
rm -rf lib rm -rf lib
# Generate the JavaScript files # Generate the JavaScript files
npm run-script build npm run-script build
@@ -16,18 +16,6 @@ if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then the PR needs attention # 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" >&2 echo "Failed: JavaScript files are not up to date. Run 'rm -rf lib && npm run-script build' to update"
git status 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 exit 1
fi fi
echo "Success: JavaScript files are up to date" echo "Success: JavaScript files are up to date"

View File

@@ -0,0 +1,20 @@
#!/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
"$(dirname "$0")/update-node-modules.sh" check-only
# 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: node_modules are not up to date. Add the 'Update dependencies' label to your PR to update them. Note it is important that node modules are updated on macOS and not any other operating system as there is one dependency (fsevents) that is needed for macOS and may not be installed if dependencies are updated on a Windows or Linux machine."
git status
exit 1
fi
echo "Success: node_modules are up to date"

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