Address PR comment.
This commit is contained in:
parent
8f4c2c76ad
commit
a7dac5c3db
4 changed files with 20 additions and 26 deletions
6
.github/workflows/pr-checks.yml
vendored
6
.github/workflows/pr-checks.yml
vendored
|
|
@ -830,21 +830,21 @@ jobs:
|
||||||
runner/dist/codeql-runner-linux upload --sarif-file src/testdata/empty-sarif.sarif --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
runner/dist/codeql-runner-linux upload --sarif-file src/testdata/empty-sarif.sarif --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
multi-language-repo_test-local-codeql:
|
multi-language-repo_test-local-codeql:
|
||||||
needs: [check-js, check-node-modules]
|
needs: [check-js, check-node-modules, check-codeql-versions]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Move codeql-action
|
- name: Move codeql-action
|
||||||
run: |
|
run: |
|
||||||
wget ${{ fromJson(needs.check-codeql-versions.outputs.nightly-url) }}
|
wget ${{ needs.check-codeql-versions.outputs.nightly-url }}
|
||||||
mkdir ../action
|
mkdir ../action
|
||||||
mv * .github ../action/
|
mv * .github ../action/
|
||||||
mv ../action/tests/multi-language-repo/{*,.github} .
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
mv ../action/.github/workflows .github
|
mv ../action/.github/workflows .github
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
with:
|
with:
|
||||||
tools: "file://../action/codeql-bundle.tar.gz"
|
tools: ../action/codeql-bundle.tar.gz
|
||||||
- name: Build code
|
- name: Build code
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
|
|
|
||||||
17
lib/codeql.js
generated
17
lib/codeql.js
generated
|
|
@ -147,21 +147,20 @@ async function getCodeQLBundleDownloadURL(apiDetails, variant, logger) {
|
||||||
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${codeQLBundleName}`;
|
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${codeQLBundleName}`;
|
||||||
}
|
}
|
||||||
async function setupCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, variant, logger) {
|
async function setupCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, variant, logger) {
|
||||||
var _a;
|
|
||||||
try {
|
try {
|
||||||
|
// We use the special value of 'latest' to prioritize the version in the
|
||||||
|
// defaults over any pinned cached version.
|
||||||
|
const forceLatest = codeqlURL === "latest";
|
||||||
|
if (forceLatest) {
|
||||||
|
codeqlURL = undefined;
|
||||||
|
}
|
||||||
let codeqlFolder;
|
let codeqlFolder;
|
||||||
let codeqlURLVersion;
|
let codeqlURLVersion;
|
||||||
if ((_a = codeqlURL) === null || _a === void 0 ? void 0 : _a.startsWith("file://")) {
|
if (codeqlURL && !codeqlURL.startsWith("http")) {
|
||||||
codeqlFolder = await toolcache.extractTar(codeqlURL.substr(7), tempDir, logger);
|
codeqlFolder = await toolcache.extractTar(codeqlURL, tempDir, logger);
|
||||||
codeqlURLVersion = "local";
|
codeqlURLVersion = "local";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// We use the special value of 'latest' to prioritize the version in the
|
|
||||||
// defaults over any pinned cached version.
|
|
||||||
const forceLatest = codeqlURL === "latest";
|
|
||||||
if (forceLatest) {
|
|
||||||
codeqlURL = undefined;
|
|
||||||
}
|
|
||||||
codeqlURLVersion = getCodeQLURLVersion(codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`);
|
codeqlURLVersion = getCodeQLURLVersion(codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`);
|
||||||
const codeqlURLSemVer = convertToSemVer(codeqlURLVersion, logger);
|
const codeqlURLSemVer = convertToSemVer(codeqlURLVersion, logger);
|
||||||
// If we find the specified version, we always use that.
|
// If we find the specified version, we always use that.
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -312,23 +312,18 @@ export async function setupCodeQL(
|
||||||
logger: Logger
|
logger: Logger
|
||||||
): Promise<{ codeql: CodeQL; toolsVersion: string }> {
|
): Promise<{ codeql: CodeQL; toolsVersion: string }> {
|
||||||
try {
|
try {
|
||||||
|
// We use the special value of 'latest' to prioritize the version in the
|
||||||
|
// defaults over any pinned cached version.
|
||||||
|
const forceLatest = codeqlURL === "latest";
|
||||||
|
if (forceLatest) {
|
||||||
|
codeqlURL = undefined;
|
||||||
|
}
|
||||||
let codeqlFolder: string;
|
let codeqlFolder: string;
|
||||||
let codeqlURLVersion: string;
|
let codeqlURLVersion: string;
|
||||||
if (codeqlURL?.startsWith("file://")) {
|
if (codeqlURL && !codeqlURL.startsWith("http")) {
|
||||||
codeqlFolder = await toolcache.extractTar(
|
codeqlFolder = await toolcache.extractTar(codeqlURL, tempDir, logger);
|
||||||
codeqlURL.substr(7),
|
|
||||||
tempDir,
|
|
||||||
logger
|
|
||||||
);
|
|
||||||
codeqlURLVersion = "local";
|
codeqlURLVersion = "local";
|
||||||
} else {
|
} else {
|
||||||
// We use the special value of 'latest' to prioritize the version in the
|
|
||||||
// defaults over any pinned cached version.
|
|
||||||
const forceLatest = codeqlURL === "latest";
|
|
||||||
if (forceLatest) {
|
|
||||||
codeqlURL = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
codeqlURLVersion = getCodeQLURLVersion(
|
codeqlURLVersion = getCodeQLURLVersion(
|
||||||
codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`
|
codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue