Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit dbe14a0

Browse files
author
Sam Lanning
authored
Merge pull request #8 from github/snapshot-to-database
Rename snapshotPath to databasePath
2 parents 1a77cde + 3171730 commit dbe14a0

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ which details the configuration for the course.
7272

7373
The file should look something like this:
7474

75-
<!-- TODO : change snapshotPath to databasePath -->
76-
7775
```json
7876
{
79-
"snapshotPath": "<path-to-database-directory>",
77+
"databasePath": "<path-to-database-directory>",
8078
"locationPaths": "https://github.com/<owner>/<repo>/blob/<sha>{path}#L{line-start}-L{line-end}",
8179
"expectedResults": {
8280
"step-01.ql": "step-01.csv",
@@ -91,7 +89,7 @@ a course image needs to also add the snapshot directory
9189
that queries should be run against,
9290
and csv files for the expected results.
9391

94-
* `snapshotPath` should be a directory in the docker image,
92+
* `databasePath` should be a directory in the docker image,
9593
relative to the `config.json` file,
9694
that contains the extracted CodeQL database that queries will be run against.
9795
If you are using the template below,

codeql-learninglab-check/package/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const CONFIG_JSON = path.join(CONFIG_PATH, 'config.json');
4545
const OUTPUT_PATH = path.join(CODEQL_HOME, 'output');
4646

4747
type Config = {
48-
snapshotPath: string;
48+
databasePath: string;
4949
/**
5050
* If set, the locations of extra or missing results can be linked to from
5151
* comments. {path} and {line-start} placeholders need to be present
@@ -61,7 +61,7 @@ type Config = {
6161
function isConfig(config: any): config is Config {
6262
if (!config)
6363
throw new Error('Configuration not specified');
64-
if (typeof config.snapshotPath !== 'string')
64+
if (typeof config.databasePath !== 'string')
6565
throw new Error('Configuration must specify a valid snapshotPath');
6666
if (typeof config.expectedResults !== 'object')
6767
throw new Error('Configuration property expectedResults invalid');
@@ -299,7 +299,7 @@ function isConfig(config: any): config is Config {
299299
console.log(`- ${query}`);
300300

301301
// Upgrade the database if neccesary
302-
const databasePath = path.join(CONFIG_PATH, config.snapshotPath);
302+
const databasePath = path.join(CONFIG_PATH, config.databasePath);
303303
console.log('Upgrading CodeQL Database');
304304
await execFile('codeql', ['database', 'upgrade', databasePath]);
305305

codeql-learninglab-check/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set -x
55

66
docker login docker.pkg.github.com -u github-actions -p ${GITHUB_TOKEN}
77

8-
PREV_IMAGE_VERSION=v0.0.5
9-
IMAGE_VERSION=v0.0.6
8+
PREV_IMAGE_VERSION=v0.0.6
9+
IMAGE_VERSION=v0.0.7
1010
IMAGE_PATH=docker.pkg.github.com/github/codeql-learninglab-actions/codeql-learninglab-check
1111
IMAGE_TAG=${IMAGE_PATH}:${IMAGE_VERSION}
1212

0 commit comments

Comments
 (0)