Skip to content

Commit b2c19fb

Browse files
authored
Merge pull request #1655 from github/update-v2.3.0-a8affb063
Merge main into releases/v2
2 parents 7df0ce3 + b203f98 commit b2c19fb

File tree

74 files changed

+773
-1846
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+773
-1846
lines changed
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: "Set up Swift"
2-
description: Performs necessary steps to set up appropriate Swift version.
2+
description: Sets up an appropriate Swift version if Swift is enabled via CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT.
33
inputs:
44
codeql-path:
5+
description: Path to the CodeQL CLI executable.
56
required: true
67
runs:
78
using: "composite"
89
steps:
910
- name: Get Swift version
1011
id: get_swift_version
11-
# We don't support Swift on Windows or prior versions of CLI.
12-
if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')"
12+
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
1313
shell: bash
1414
env:
15-
CODEQL_PATH: ${{inputs.codeql-path}}
15+
CODEQL_PATH: ${{ inputs.codeql-path }}
1616
run: |
1717
if [ $RUNNER_OS = "macOS" ]; then
1818
PLATFORM="osx64"
@@ -26,7 +26,7 @@ runs:
2626
VERSION="5.7.0"
2727
fi
2828
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
29-
- uses: swift-actions/setup-swift@da0e3e04b5e3e15dbc3861bd835ad9f0afe56296 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
30-
if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')"
29+
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
30+
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
3131
with:
32-
swift-version: "${{steps.get_swift_version.outputs.version}}"
32+
swift-version: "${{ steps.get_swift_version.outputs.version }}"

.github/actions/update-bundle/index.ts

+39-41
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,55 @@ interface Defaults {
1313
priorCliVersion: string;
1414
}
1515

16-
const CODEQL_BUNDLE_PREFIX = 'codeql-bundle-';
17-
1816
function getCodeQLCliVersionForRelease(release): string {
1917
// We do not currently tag CodeQL bundles based on the CLI version they contain.
2018
// Instead, we use a marker file `cli-version-<version>.txt` to record the CLI version.
2119
// This marker file is uploaded as a release asset for all new CodeQL bundles.
2220
const cliVersionsFromMarkerFiles = release.assets
23-
.map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1])
24-
.filter((v) => v)
25-
.map((v) => v as string);
21+
.map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1])
22+
.filter((v) => v)
23+
.map((v) => v as string);
2624
if (cliVersionsFromMarkerFiles.length > 1) {
2725
throw new Error(
2826
`Release ${release.tag_name} has multiple CLI version marker files.`
29-
);
30-
} else if (cliVersionsFromMarkerFiles.length === 0) {
31-
throw new Error(
32-
`Failed to find the CodeQL CLI version for release ${release.tag_name}.`
33-
);
34-
}
35-
return cliVersionsFromMarkerFiles[0];
36-
}
27+
);
28+
} else if (cliVersionsFromMarkerFiles.length === 0) {
29+
throw new Error(
30+
`Failed to find the CodeQL CLI version for release ${release.tag_name}.`
31+
);
32+
}
33+
return cliVersionsFromMarkerFiles[0];
34+
}
3735

38-
async function getBundleInfoFromRelease(release): Promise<BundleInfo> {
39-
return {
40-
bundleVersion: release.tag_name.substring(CODEQL_BUNDLE_PREFIX.length),
41-
cliVersion: getCodeQLCliVersionForRelease(release)
42-
};
43-
}
36+
async function getBundleInfoFromRelease(release): Promise<BundleInfo> {
37+
return {
38+
bundleVersion: release.tag_name,
39+
cliVersion: getCodeQLCliVersionForRelease(release)
40+
};
41+
}
4442

45-
async function getNewDefaults(currentDefaults: Defaults): Promise<Defaults> {
46-
const release = github.context.payload.release;
47-
console.log('Updating default bundle as a result of the following release: ' +
48-
`${JSON.stringify(release)}.`)
43+
async function getNewDefaults(currentDefaults: Defaults): Promise<Defaults> {
44+
const release = github.context.payload.release;
45+
console.log('Updating default bundle as a result of the following release: ' +
46+
`${JSON.stringify(release)}.`)
4947

50-
const bundleInfo = await getBundleInfoFromRelease(release);
51-
return {
52-
bundleVersion: bundleInfo.bundleVersion,
53-
cliVersion: bundleInfo.cliVersion,
54-
priorBundleVersion: currentDefaults.bundleVersion,
55-
priorCliVersion: currentDefaults.cliVersion
56-
};
57-
}
48+
const bundleInfo = await getBundleInfoFromRelease(release);
49+
return {
50+
bundleVersion: bundleInfo.bundleVersion,
51+
cliVersion: bundleInfo.cliVersion,
52+
priorBundleVersion: currentDefaults.bundleVersion,
53+
priorCliVersion: currentDefaults.cliVersion
54+
};
55+
}
5856

59-
async function main() {
60-
const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8'));
61-
const newDefaults = await getNewDefaults(previousDefaults);
62-
// Update the source file in the repository. Calling workflows should subsequently rebuild
63-
// the Action to update `lib/defaults.json`.
64-
fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n");
65-
}
57+
async function main() {
58+
const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8'));
59+
const newDefaults = await getNewDefaults(previousDefaults);
60+
// Update the source file in the repository. Calling workflows should subsequently rebuild
61+
// the Action to update `lib/defaults.json`.
62+
fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n");
63+
}
6664

67-
// Ideally, we'd await main() here, but that doesn't work well with `ts-node`.
68-
// So instead we rely on the fact that Node won't exit until the event loop is empty.
69-
main();
65+
// Ideally, we'd await main() here, but that doesn't work well with `ts-node`.
66+
// So instead we rely on the fact that Node won't exit until the event loop is empty.
67+
main();

.github/workflows/__analyze-ref-input.yml

+29-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__autobuild-action.yml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__config-export.yml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__diagnostics-export.yml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__export-file-baseline-information.yml

+15-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__extractor-ram-threads.yml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-queries.yml

+29-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)