Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/main' into vercel/pkg
 the commit.
Robert Brignull committed Aug 25, 2020

Unverified

No user is associated with the committer email.
2 parents d6daa45 + ab457be commit c3c86d8
Showing 38 changed files with 37 additions and 187 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pr-checks.yml
@@ -24,6 +24,8 @@ jobs:
>&2 echo "Failed: Repo should be clean before testing!"
exit 1
fi
# Wipe the lib directory incase there are extra unnecessary files in there
rm -rf lib
# Generate the JavaScript files
npm run-script build
# Check that repo is still clean
2 changes: 1 addition & 1 deletion analyze/action.yml
@@ -29,4 +29,4 @@ inputs:
default: ${{ toJson(matrix) }}
runs:
using: 'node12'
main: '../lib/finalize-db.js'
main: '../lib/analyze-action.js'
2 changes: 1 addition & 1 deletion autobuild/action.yml
@@ -8,4 +8,4 @@ inputs:
default: ${{ toJson(matrix) }}
runs:
using: 'node12'
main: '../lib/autobuild.js'
main: '../lib/autobuild-action.js'
2 changes: 1 addition & 1 deletion init/action.yml
@@ -18,4 +18,4 @@ inputs:
required: false
runs:
using: 'node12'
main: '../lib/setup-tracer.js'
main: '../lib/init-action.js'
2 changes: 1 addition & 1 deletion lib/finalize-db.js → lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/analyze-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/autobuild.js → lib/autobuild-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/autobuild-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/autobuild.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion lib/config-utils.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.test.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion lib/external-queries.js
2 changes: 1 addition & 1 deletion lib/external-queries.js.map
5 changes: 3 additions & 2 deletions lib/external-queries.test.js
2 changes: 1 addition & 1 deletion lib/external-queries.test.js.map
1 change: 0 additions & 1 deletion lib/finalize-db.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions lib/finalize-db.test.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/finalize-db.test.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion lib/setup-tracer.js → lib/init-action.js
1 change: 1 addition & 0 deletions lib/init-action.js.map
76 changes: 0 additions & 76 deletions lib/setup-tools.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/setup-tools.js.map

This file was deleted.

60 changes: 0 additions & 60 deletions lib/setup-tools.test.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/setup-tools.test.js.map

This file was deleted.

1 change: 0 additions & 1 deletion lib/setup-tracer.js.map

This file was deleted.

22 changes: 0 additions & 22 deletions lib/test-utils.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/test-utils.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion lib/upload-sarif.js → lib/upload-sarif-action.js
1 change: 1 addition & 0 deletions lib/upload-sarif-action.js.map
1 change: 0 additions & 1 deletion lib/upload-sarif.js.map

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/config-utils.test.ts
@@ -310,7 +310,7 @@ test("API client used when reading remote config", async t => {
const spyGetContents = mockGetContents(dummyResponse);

// Create checkout directory for remote queries repository
fs.mkdirSync(path.join(tmpDir, 'foo/bar'), { recursive: true });
fs.mkdirSync(path.join(tmpDir, 'foo/bar/dev'), { recursive: true });

setInput('config-file', 'octo-org/codeql-config/config.yaml@main');
setInput('languages', 'javascript');
5 changes: 3 additions & 2 deletions src/external-queries.test.ts
@@ -10,12 +10,13 @@ setupTests(test);

test("checkoutExternalQueries", async t => {
await util.withTmpDir(async tmpDir => {
const ref = "df4c6869212341b601005567381944ed90906b6b";
await externalQueries.checkoutExternalRepository(
"github/codeql-go",
"df4c6869212341b601005567381944ed90906b6b",
ref,
tmpDir);

// COPYRIGHT file existed in df4c6869212341b601005567381944ed90906b6b but not in the default branch
t.true(fs.existsSync(path.join(tmpDir, "github", "codeql-go", "COPYRIGHT")));
t.true(fs.existsSync(path.join(tmpDir, "github", "codeql-go", ref, "COPYRIGHT")));
});
});
8 changes: 7 additions & 1 deletion src/external-queries.ts
@@ -9,7 +9,13 @@ import * as path from 'path';
export async function checkoutExternalRepository(repository: string, ref: string, tempDir: string): Promise<string> {
core.info('Checking out ' + repository);

const checkoutLocation = path.join(tempDir, repository);
const checkoutLocation = path.join(tempDir, repository, ref);

if (!checkoutLocation.startsWith(tempDir)) {
// this still permits locations that mess with sibling repositories in `tempDir`, but that is acceptable
throw new Error(`'${repository}@${ref}' is not a valid repository and reference.`);
}

if (!fs.existsSync(checkoutLocation)) {
const repoURL = 'https://github.com/' + repository + '.git';
await exec.exec('git', ['clone', repoURL, checkoutLocation]);
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion upload-sarif/action.yml
@@ -16,4 +16,4 @@ inputs:
default: ${{ toJson(matrix) }}
runs:
using: 'node12'
main: '../lib/upload-sarif.js'
main: '../lib/upload-sarif-action.js'

0 comments on commit c3c86d8

Please sign in to comment.