Skip to content

Commit

Permalink
fix: handle truncated job names
Browse files Browse the repository at this point in the history
  • Loading branch information
qoomon committed Oct 8, 2024
1 parent 39076cc commit 565de6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44573,6 +44573,9 @@ function getAbsoluteJobName({ job, matrix, workflowContextChain }) {
actualJobName = `${actualJobName} (${flatValues.join(', ')})`;
}
}
if (actualJobName.length > 98) {
actualJobName = actualJobName.substring(0, 98) + '...';
}
workflowContextChain?.forEach((workflowContext) => {
const contextJob = getAbsoluteJobName(workflowContext);
actualJobName = `${contextJob} / ${actualJobName}`;
Expand Down Expand Up @@ -44620,6 +44623,7 @@ async function getJobObject(octokit) {
matrix: getInput('#job-matrix', JobMatrixParser),
workflowContextChain: getInput('workflow-context', WorkflowContextParser),
});
console.error('absoluteJobName', absoluteJobName);
const workflowRunJobs = await octokit.paginate(octokit.rest.actions.listJobsForWorkflowRunAttempt, {
...context.repo,
run_id: context.runId,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ function getAbsoluteJobName({job, matrix, workflowContextChain}: {
actualJobName = `${actualJobName} (${flatValues.join(', ')})`
}
}
if (actualJobName.length > 98) {
actualJobName = actualJobName.substring(0, 98) + '...'
}

workflowContextChain?.forEach((workflowContext) => {
const contextJob = getAbsoluteJobName(workflowContext)
Expand Down Expand Up @@ -270,6 +273,8 @@ export async function getJobObject(octokit: InstanceType<typeof GitHub>): Promis
workflowContextChain: getInput('workflow-context', WorkflowContextParser),
})

console.error('absoluteJobName', absoluteJobName)

const workflowRunJobs = await octokit.paginate(octokit.rest.actions.listJobsForWorkflowRunAttempt, {
...context.repo,
run_id: context.runId,
Expand Down

0 comments on commit 565de6b

Please sign in to comment.