Skip to content

Commit

Permalink
Add a better log message for reusable workflow calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed Dec 21, 2022
1 parent 8d1e008 commit 8b9e982
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/workflow.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/workflow.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface WorkflowJob {
name?: string;
"runs-on"?: string;
steps?: WorkflowJobStep[];
uses?: string;
}

interface WorkflowTrigger {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 8b9e982

Please sign in to comment.