Skip to content

Commit 0e7ed61

Browse files
committed
Fix #229: Poll new workflow run for status updates
1 parent f7cfef8 commit 0e7ed61

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/commands/triggerWorkflowRun.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import {getGitHead, getGitHubContextForWorkspaceUri, GitHubRepoContext} from "..
44
import {getWorkflowUri, parseWorkflowFile} from "../workflow/workflow";
55

66
import {Workflow} from "../model";
7+
import {RunStore} from "../store/store";
78

89
interface TriggerRunCommandOptions {
910
wf?: Workflow;
1011
gitHubRepoContext: GitHubRepoContext;
1112
}
1213

13-
export function registerTriggerWorkflowRun(context: vscode.ExtensionContext) {
14+
export function registerTriggerWorkflowRun(context: vscode.ExtensionContext, store: RunStore) {
1415
context.subscriptions.push(
1516
vscode.commands.registerCommand(
1617
"github-actions.explorer.triggerRun",
@@ -171,6 +172,7 @@ export function registerTriggerWorkflowRun(context: vscode.ExtensionContext) {
171172
const newLatestRunId = result.data.workflow_runs[0]?.id;
172173
if (newLatestRunId && newLatestRunId !== latestRunId) {
173174
await vscode.commands.executeCommand("github-actions.explorer.refresh");
175+
store.pollRun(newLatestRunId, gitHubRepoContext, 1000, 20);
174176
break;
175177
}
176178
} catch (e) {

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export async function activate(context: vscode.ExtensionContext) {
7373
registerOpenWorkflowFile(context);
7474
registerOpenWorkflowJobLogs(context);
7575
registerOpenWorkflowStepLogs(context);
76-
registerTriggerWorkflowRun(context);
76+
registerTriggerWorkflowRun(context, store);
7777
registerReRunWorkflowRun(context);
7878
registerCancelWorkflowRun(context);
7979

0 commit comments

Comments
 (0)