Skip to content

Commit ce0a7fa

Browse files
authored
When listing workflows running as checks against a PR, include workflow name, not just job name (#6567)
Fixes #6497
1 parent 6dad4da commit ce0a7fa

5 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/github/githubRepository.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,8 @@ export class GitHubRepository extends Disposable {
15361536
state: this.mapStateAsCheckState(context.conclusion),
15371537
description: context.title,
15381538
context: context.name,
1539+
workflowName: context.checkSuite?.workflowRun?.workflow.name,
1540+
event: context.checkSuite?.workflowRun?.event,
15391541
targetUrl: context.detailsUrl,
15401542
isRequired: context.isRequired,
15411543
};
@@ -1549,6 +1551,8 @@ export class GitHubRepository extends Disposable {
15491551
state: this.mapStateAsCheckState(context.state),
15501552
description: context.description,
15511553
context: context.context,
1554+
workflowName: undefined,
1555+
event: undefined,
15521556
targetUrl: context.targetUrl,
15531557
isRequired: context.isRequired,
15541558
};
@@ -1571,6 +1575,8 @@ export class GitHubRepository extends Disposable {
15711575
state: CheckState.Pending,
15721576
description: vscode.l10n.t('Waiting for status to be reported'),
15731577
context: context,
1578+
workflowName: undefined,
1579+
event: undefined,
15741580
targetUrl: prUrl,
15751581
isRequired: true
15761582
});

src/github/graphql.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,12 @@ export interface CheckRun {
878878
logoUrl: string;
879879
url: string;
880880
} | null;
881+
workflowRun?: {
882+
event: string;
883+
workflow: {
884+
name: string;
885+
};
886+
};
881887
};
882888
isRequired: boolean;
883889
}

src/github/interface.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ export interface PullRequestCheckStatus {
306306
state: CheckState;
307307
description: string | null;
308308
targetUrl: string | null;
309-
context: string;
309+
context: string; // Job name
310+
workflowName: string | undefined;
311+
event: string | undefined;
310312
isRequired: boolean;
311313
}
312314

src/github/queriesShared.gql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,12 @@ query GetChecks($owner: String!, $name: String!, $number: Int!) {
11661166
logoUrl
11671167
url
11681168
}
1169+
workflowRun {
1170+
event
1171+
workflow {
1172+
name
1173+
}
1174+
}
11691175
}
11701176
}
11711177
}

webviews/components/merge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ const StatusCheckDetails = ( { statuses }: { statuses: PullRequestCheckStatus[]
526526
<Avatar for={{ avatarUrl: s.avatarUrl, url: s.url }} />
527527
<span className="status-check-detail-text">
528528
{/* allow-any-unicode-next-line */}
529-
{s.context} {s.description ? `— ${s.description}` : ''}
529+
{s.workflowName ? `${s.workflowName} / ` : null}{s.context}{s.event ? ` (${s.event})` : null} {s.description ? `— ${s.description}` : null}
530530
</span>
531531
</div>
532532
<div>

0 commit comments

Comments
 (0)