Skip to content

Commit de57049

Browse files
committed
Use new endpoint for running remote queries
1 parent 977b061 commit de57049

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ interface Config {
1313
// Test "controller" repository and workflow.
1414
const OWNER = 'dsp-testing';
1515
const REPO = 'qc-controller';
16-
const WORKFLOW_ID = 'codeql-query.yml';
1716

1817
export default async function runRemoteQuery(credentials: Credentials, uri?: Uri) {
1918
if (!uri?.fsPath.endsWith('.ql')) {
@@ -36,21 +35,23 @@ export default async function runRemoteQuery(credentials: Credentials, uri?: Uri
3635

3736
const ref = config.ref || 'main';
3837
const language = config.language;
39-
const repositories = JSON.stringify(config.repositories);
38+
const repositories = config.repositories;
4039

4140
try {
42-
await octokit.rest.actions.createWorkflowDispatch({
43-
owner: OWNER,
44-
repo: REPO,
45-
workflow_id: WORKFLOW_ID,
46-
ref: ref,
47-
inputs: {
48-
language,
49-
repositories,
50-
query,
51-
token
41+
await octokit.request(
42+
'POST /repos/:owner/:repo/code-scanning/codeql/queries',
43+
{
44+
owner: OWNER,
45+
repo: REPO,
46+
data: {
47+
ref: ref,
48+
language: language,
49+
repositories: repositories,
50+
query: query,
51+
token: token,
52+
}
5253
}
53-
});
54+
);
5455
void showAndLogInformationMessage(`Successfully scheduled runs. [Click here to see the progress](https://github.com/${OWNER}/${REPO}/actions).`);
5556

5657
} catch (error) {

0 commit comments

Comments
 (0)