Add a better log message for reusable workflow calls

This commit is contained in:
Henry Mercer 2022-12-21 11:13:48 +00:00
parent 8d1e008ecb
commit 8b9e982393
3 changed files with 10 additions and 1 deletions

3
lib/workflow.js generated
View file

@ -247,6 +247,9 @@ function getWorkflowRunID() {
}
exports.getWorkflowRunID = getWorkflowRunID;
function getStepsCallingAction(job, actionName) {
if (job.uses) {
throw new Error(`Could not get steps calling ${actionName} since the job calls a reusable workflow.`);
}
const steps = job.steps;
if (!Array.isArray(steps)) {
throw new Error(`Could not get steps calling ${actionName} since job.steps was not an array.`);

File diff suppressed because one or more lines are too long

View file

@ -18,6 +18,7 @@ interface WorkflowJob {
name?: string;
"runs-on"?: string;
steps?: WorkflowJobStep[];
uses?: string;
}
interface WorkflowTrigger {
@ -301,6 +302,11 @@ function getStepsCallingAction(
job: WorkflowJob,
actionName: string
): WorkflowJobStep[] {
if (job.uses) {
throw new Error(
`Could not get steps calling ${actionName} since the job calls a reusable workflow.`
);
}
const steps = job.steps;
if (!Array.isArray(steps)) {
throw new Error(