Skip to content

Commit 0743700

Browse files
committed
Start linking to the exact workflow run
Now that the queries endpoint returns the id we can link straight there. We'll make more changes to the progress tracking, but I think it's worth making this minimal change now.
1 parent 0ef635b commit 0743700

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { logger } from './logging';
1010
import { getRemoteControllerRepo, getRemoteRepositoryLists, setRemoteControllerRepo } from './config';
1111
import { tmpDir } from './run-queries';
1212
import { ProgressCallback, UserCancellationException } from './commandRunner';
13+
import { OctokitResponse } from '@octokit/types/dist-types';
14+
1315
interface Config {
1416
repositories: string[];
1517
ref?: string;
@@ -20,6 +22,10 @@ interface RepoListQuickPickItem extends QuickPickItem {
2022
repoList: string[];
2123
}
2224

25+
interface QueriesResponse {
26+
workflow_run_id: number
27+
}
28+
2329
/**
2430
* This regex matches strings of the form `owner/repo` where:
2531
* - `owner` is made up of alphanumeric characters or single hyphens, starting and ending in an alphanumeric character
@@ -347,7 +353,7 @@ async function runRemoteQueriesApiRequest(
347353

348354
try {
349355
const octokit = await credentials.getOctokit();
350-
await octokit.request(
356+
const response: OctokitResponse<QueriesResponse, number> = await octokit.request(
351357
'POST /repos/:owner/:repo/code-scanning/codeql/queries',
352358
{
353359
owner,
@@ -360,7 +366,7 @@ async function runRemoteQueriesApiRequest(
360366
}
361367
}
362368
);
363-
void showAndLogInformationMessage(`Successfully scheduled runs. [Click here to see the progress](https://github.com/${owner}/${repo}/actions).`);
369+
void showAndLogInformationMessage(`Successfully scheduled runs. [Click here to see the progress](https://github.com/${owner}/${repo}/actions/runs/${response.data.workflow_run_id}).`);
364370

365371
} catch (error) {
366372
await attemptRerun(error, credentials, ref, language, repositories, owner, repo, queryPackBase64, dryRun);

0 commit comments

Comments
 (0)