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.
This commit is contained in:
@@ -10,6 +10,8 @@ import { logger } from './logging';
|
|||||||
import { getRemoteControllerRepo, getRemoteRepositoryLists, setRemoteControllerRepo } from './config';
|
import { getRemoteControllerRepo, getRemoteRepositoryLists, setRemoteControllerRepo } from './config';
|
||||||
import { tmpDir } from './run-queries';
|
import { tmpDir } from './run-queries';
|
||||||
import { ProgressCallback, UserCancellationException } from './commandRunner';
|
import { ProgressCallback, UserCancellationException } from './commandRunner';
|
||||||
|
import { OctokitResponse } from '@octokit/types/dist-types';
|
||||||
|
|
||||||
interface Config {
|
interface Config {
|
||||||
repositories: string[];
|
repositories: string[];
|
||||||
ref?: string;
|
ref?: string;
|
||||||
@@ -20,6 +22,10 @@ interface RepoListQuickPickItem extends QuickPickItem {
|
|||||||
repoList: string[];
|
repoList: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface QueriesResponse {
|
||||||
|
workflow_run_id: number
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This regex matches strings of the form `owner/repo` where:
|
* This regex matches strings of the form `owner/repo` where:
|
||||||
* - `owner` is made up of alphanumeric characters or single hyphens, starting and ending in an alphanumeric character
|
* - `owner` is made up of alphanumeric characters or single hyphens, starting and ending in an alphanumeric character
|
||||||
@@ -347,7 +353,7 @@ async function runRemoteQueriesApiRequest(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const octokit = await credentials.getOctokit();
|
const octokit = await credentials.getOctokit();
|
||||||
await octokit.request(
|
const response: OctokitResponse<QueriesResponse, number> = await octokit.request(
|
||||||
'POST /repos/:owner/:repo/code-scanning/codeql/queries',
|
'POST /repos/:owner/:repo/code-scanning/codeql/queries',
|
||||||
{
|
{
|
||||||
owner,
|
owner,
|
||||||
@@ -360,7 +366,7 @@ async function runRemoteQueriesApiRequest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
void showAndLogInformationMessage(`Successfully scheduled runs. [Click here to see the progress](https://github.com/${owner}/${repo}/actions).`);
|
void showAndLogInformationMessage(`Successfully scheduled runs. [Click here to see the progress](https://github.com/${owner}/${repo}/actions/runs/${response.data.workflow_run_id}).`);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await attemptRerun(error, credentials, ref, language, repositories, owner, repo, queryPackBase64, dryRun);
|
await attemptRerun(error, credentials, ref, language, repositories, owner, repo, queryPackBase64, dryRun);
|
||||||
|
|||||||
Reference in New Issue
Block a user