Skip to content

Commit 140b32e

Browse files
committed
refactor: improve logging
1 parent 5b05d74 commit 140b32e

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/__snapshots__/return-dispatch.spec.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`return-dispatch > handleAction > getRunIdAndUrl > called fetchWorkflowRunIds with the provided workflowId and branch 1`] = `
44
[
5-
"Attempting to identify Run ID for workflow.yml (123)",
5+
"Attempting to identify run ID for workflow.yml (123)",
66
]
77
`;
88

@@ -20,7 +20,7 @@ exports[`return-dispatch > handleAction > getRunIdAndUrl > called fetchWorkflowR
2020

2121
exports[`return-dispatch > handleAction > getRunIdAndUrl > should call retryOrTimeout with the larger workflowTimeoutMs timeout value 1`] = `
2222
[
23-
"Attempting to identify Run ID for workflow.yml (123)",
23+
"Attempting to identify run ID for workflow.yml (123)",
2424
]
2525
`;
2626

@@ -40,15 +40,15 @@ exports[`return-dispatch > handleAction > getRunIdAndUrl > should retry until an
4040

4141
exports[`return-dispatch > handleAction > getRunIdAndUrl > should retry until an ID is found 2`] = `"No Run IDs found for workflow, attempt 1..."`;
4242

43-
exports[`return-dispatch > handleAction > getRunIdAndUrl > should retry until an ID is found 3`] = `"Attempting to identify Run ID for workflow.yml (123)"`;
43+
exports[`return-dispatch > handleAction > getRunIdAndUrl > should retry until an ID is found 3`] = `"Attempting to identify run ID for workflow.yml (123)"`;
4444

4545
exports[`return-dispatch > handleAction > getRunIdAndUrl > should retry until an ID is found 4`] = `"No Run IDs found for workflow, attempt 2..."`;
4646

4747
exports[`return-dispatch > handleAction > getRunIdAndUrl > should retry until an ID is found 5`] = `"Attempting to get step names for Run IDs: [0]"`;
4848

4949
exports[`return-dispatch > handleAction > getRunIdAndUrl > should return the ID when found 1`] = `
5050
[
51-
"Attempting to identify Run ID for workflow.yml (123)",
51+
"Attempting to identify run ID for workflow.yml (123)",
5252
]
5353
`;
5454

@@ -66,7 +66,7 @@ exports[`return-dispatch > handleAction > getRunIdAndUrl > should return the ID
6666

6767
exports[`return-dispatch > handleAction > getRunIdAndUrl > should timeout when unable failing to get the run IDs 1`] = `
6868
[
69-
"Attempting to identify Run ID for workflow.yml (123)",
69+
"Attempting to identify run ID for workflow.yml (123)",
7070
]
7171
`;
7272

@@ -80,7 +80,7 @@ exports[`return-dispatch > handleAction > getRunIdAndUrl > should timeout when u
8080

8181
exports[`return-dispatch > handleAction > getRunIdAndUrl > should timeout when unable to find over time 2`] = `"Exhausted searching IDs in known runs, attempt 1..."`;
8282

83-
exports[`return-dispatch > handleAction > getRunIdAndUrl > should timeout when unable to find over time 3`] = `"Attempting to identify Run ID for workflow.yml (123)"`;
83+
exports[`return-dispatch > handleAction > getRunIdAndUrl > should timeout when unable to find over time 3`] = `"Attempting to identify run ID for workflow.yml (123)"`;
8484

8585
exports[`return-dispatch > handleAction > getRunIdAndUrl > should timeout when unable to find over time 4`] = `"Attempting to get step names for Run IDs: [0]"`;
8686

src/api.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ describe("API", () => {
547547
Repository: owner/repo
548548
Workflow Run ID: 0
549549
Jobs Fetched: [0]
550-
Steps Fetched: [Test Step 1, Test Step 2]"
550+
Steps Fetched: ["Test Step 1", "Test Step 2"]"
551551
`,
552552
);
553553
});

src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export async function fetchWorkflowRunJobSteps(
244244
` Repository: ${config.owner}/${config.repo}\n` +
245245
` Workflow Run ID: ${runId}\n` +
246246
` Jobs Fetched: [${jobs.map((job) => job.id).join(", ")}]\n` +
247-
` Steps Fetched: [${steps.join(", ")}]`,
247+
` Steps Fetched: [${steps.map((step) => `"${step}"`).join(", ")}]`,
248248
);
249249

250250
return steps;

src/return-dispatch.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ describe("return-dispatch", () => {
593593
assertOnlyCalled(coreDebugLogMock, coreInfoLogMock);
594594
expect(coreDebugLogMock).toHaveBeenCalledTimes(2);
595595
expect(coreDebugLogMock.mock.calls[0]?.[0]).toMatchInlineSnapshot(
596-
`"Attempting to identify Run ID for workflow.yml (123)"`,
596+
`"Attempting to identify run ID for workflow.yml (123)"`,
597597
);
598598
expect(coreDebugLogMock.mock.calls[1]?.[0]).toMatchInlineSnapshot(
599599
`"Attempting to get step names for Run IDs: [0]"`,

src/return-dispatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export async function getRunIdAndUrl({
146146
);
147147

148148
core.info("Attempting to identify run ID from steps...");
149-
core.debug(`Attempting to identify Run ID for ${workflow} (${workflowId})`);
149+
core.debug(`Attempting to identify run ID for ${workflow} (${workflowId})`);
150150

151151
let attemptNo = 0;
152152
let elapsedTime = Date.now() - startTime;

0 commit comments

Comments
 (0)