When running my ci workflow with a manual dispatch, get this
Context
Step's details:
Run stoplightio/spectral-action@latest
with:
file_glob: docs/[...].yaml
repo_token: ***
event_name: workflow_dispatch
Current Behavior
Error: member 0
└─ required property "pull_request"
└─ cannot decode undefined, should be Record<string, unknown>
member 1
└─ required property "after"
└─ cannot decode undefined, should be string
Expected Behavior
No errors, like the action runs from PRs and pulls.
Possible Workaround/Solution
It looks like extending this runtime type to not expect a pull_request field all the times should do the job:
|
const PullRequestEvent = pipe( |
|
D.struct({ |
|
repository: RepositoryStruct, |
|
pull_request: D.struct({ |
|
head: D.struct({ |
|
sha: D.string, |
|
}), |
|
}), |
|
}), |
|
D.intersect( |
|
D.partial({ |
|
after: D.string, |
|
}) |
|
) |
|
); |
Steps to Reproduce
Create a workflow with:
name: ci
on:
push:
workflow_dispatch:
and use this to run this action.
When running my ci workflow with a manual dispatch, get this
Context
Step's details:
Current Behavior
Expected Behavior
No errors, like the action runs from PRs and pulls.
Possible Workaround/Solution
It looks like extending this runtime type to not expect a
pull_requestfield all the times should do the job:spectral-action/src/octokit.ts
Lines 25 to 39 in 6416fd0
Steps to Reproduce
Create a workflow with:
and use this to run this action.
latest