Skip to content

Commit 31bd105

Browse files
committed
remove newlines from names
1 parent c2e8dc6 commit 31bd105

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/treeViews/currentBranch.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,15 @@ export class CurrentBranchTreeProvider
112112

113113
const resp = result.data;
114114
const runs = resp.workflow_runs;
115+
// We are removing newlines from workflow names for presentation purposes
116+
const runsWithNamesWithNoNewlines = runs.map(run => {
117+
if (run.name) {
118+
run.name = run.name.replace(/(\r\n|\n|\r)/gm, " ");
119+
}
120+
121+
return run;
122+
});
115123

116-
return this.runNodes(gitHubRepoContext, runs, true);
124+
return this.runNodes(gitHubRepoContext, runsWithNamesWithNoNewlines, true);
117125
}
118126
}

src/treeViews/workflows/workflowsRepoNode.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export async function getWorkflowNodes(gitHubRepoContext: GitHubRepoContext) {
3636
workflows.map(async wf => {
3737
const workflowUri = getWorkflowUri(gitHubRepoContext, wf.path);
3838
const workflowContext = await getContextStringForWorkflow(workflowUri);
39+
const nameWithoutNewlines = wf.name.replace(/(\r\n|\n|\r)/gm, " ");
40+
41+
// We are removing all newline characters from the workflow name for presentation purposes
42+
wf.name = nameWithoutNewlines;
3943

4044
return new WorkflowNode(gitHubRepoContext, wf, workflowContext);
4145
})

0 commit comments

Comments
 (0)