Skip to content

Commit a7dac5c

Browse files
Address PR comment.
1 parent 8f4c2c7 commit a7dac5c

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

.github/workflows/pr-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,21 +830,21 @@ jobs:
830830
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 }}
831831
832832
multi-language-repo_test-local-codeql:
833-
needs: [check-js, check-node-modules]
833+
needs: [check-js, check-node-modules, check-codeql-versions]
834834
runs-on: ubuntu-latest
835835

836836
steps:
837837
- uses: actions/checkout@v2
838838
- name: Move codeql-action
839839
run: |
840-
wget ${{ fromJson(needs.check-codeql-versions.outputs.nightly-url) }}
840+
wget ${{ needs.check-codeql-versions.outputs.nightly-url }}
841841
mkdir ../action
842842
mv * .github ../action/
843843
mv ../action/tests/multi-language-repo/{*,.github} .
844844
mv ../action/.github/workflows .github
845845
- uses: ./../action/init
846846
with:
847-
tools: "file://../action/codeql-bundle.tar.gz"
847+
tools: ../action/codeql-bundle.tar.gz
848848
- name: Build code
849849
run: ./build.sh
850850
- uses: ./../action/analyze

lib/codeql.js

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codeql.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -312,23 +312,18 @@ export async function setupCodeQL(
312312
logger: Logger
313313
): Promise<{ codeql: CodeQL; toolsVersion: string }> {
314314
try {
315+
// We use the special value of 'latest' to prioritize the version in the
316+
// defaults over any pinned cached version.
317+
const forceLatest = codeqlURL === "latest";
318+
if (forceLatest) {
319+
codeqlURL = undefined;
320+
}
315321
let codeqlFolder: string;
316322
let codeqlURLVersion: string;
317-
if (codeqlURL?.startsWith("file://")) {
318-
codeqlFolder = await toolcache.extractTar(
319-
codeqlURL.substr(7),
320-
tempDir,
321-
logger
322-
);
323+
if (codeqlURL && !codeqlURL.startsWith("http")) {
324+
codeqlFolder = await toolcache.extractTar(codeqlURL, tempDir, logger);
323325
codeqlURLVersion = "local";
324326
} else {
325-
// We use the special value of 'latest' to prioritize the version in the
326-
// defaults over any pinned cached version.
327-
const forceLatest = codeqlURL === "latest";
328-
if (forceLatest) {
329-
codeqlURL = undefined;
330-
}
331-
332327
codeqlURLVersion = getCodeQLURLVersion(
333328
codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`
334329
);

0 commit comments

Comments
 (0)