Skip to content

Commit 6a56951

Browse files
committed
Tidy up "run-remote-query.ts"
1 parent 95200b2 commit 6a56951

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

extensions/ql-vscode/src/run-remote-query.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ interface Config {
1010
language: string;
1111
}
1212

13+
// Test "controller" repository and workflow.
14+
const OWNER = 'dsp-testing';
15+
const REPO = 'qc-controller';
16+
const WORKFLOW_ID = 'codeql-query.yml';
17+
1318
export default async function runRemoteQuery(credentials: Credentials, uri?: Uri) {
1419
if (!uri || !uri.fsPath.endsWith('.ql')) {
1520
return;
@@ -23,7 +28,7 @@ export default async function runRemoteQuery(credentials: Credentials, uri?: Uri
2328

2429
const repositoriesFile = queryFile.substring(0, queryFile.length - '.ql'.length) + '.repositories';
2530
if (!(await fs.pathExists(repositoriesFile))) {
26-
void showAndLogErrorMessage(`Missing file: '${repositoriesFile}' to specify the repositories to run against.`);
31+
void showAndLogErrorMessage(`Missing file: '${repositoriesFile}' to specify the repositories to run against. This file must be a sibling of ${queryFile}.`);
2732
return;
2833
}
2934

@@ -33,16 +38,11 @@ export default async function runRemoteQuery(credentials: Credentials, uri?: Uri
3338
const language = config.language;
3439
const repositories = JSON.stringify(config.repositories);
3540

36-
// Test "controller" repository and workflow.
37-
const owner = 'dsp-testing';
38-
const repo = 'qc-controller';
39-
const workflow_id = 'codeql-query.yml';
40-
4141
try {
4242
await octokit.rest.actions.createWorkflowDispatch({
43-
owner: owner,
44-
repo: repo,
45-
workflow_id: workflow_id,
43+
owner: OWNER,
44+
repo: REPO,
45+
workflow_id: WORKFLOW_ID,
4646
ref: ref,
4747
inputs: {
4848
language,
@@ -51,7 +51,7 @@ export default async function runRemoteQuery(credentials: Credentials, uri?: Uri
5151
token
5252
}
5353
});
54-
void showAndLogInformationMessage(`Successfully scheduled runs. [Click here to see the progress](https://github.com/${owner}/${repo}/actions).`);
54+
void showAndLogInformationMessage(`Successfully scheduled runs. [Click here to see the progress](https://github.com/${OWNER}/${REPO}/actions).`);
5555

5656
} catch (error) {
5757
void showAndLogErrorMessage(error);

0 commit comments

Comments
 (0)