Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use with workflow_dispatch #38

Open
mverleg opened this issue Jul 14, 2021 · 1 comment
Open

Use with workflow_dispatch #38

mverleg opened this issue Jul 14, 2021 · 1 comment

Comments

@mverleg
Copy link

mverleg commented Jul 14, 2021

When manually running an Action, I get this error, which makes sense:

Error: This action only supports pull requests and pushes, workflow_dispatch events are not supported.

However this even happens if I add

if: github.event_name != 'workflow_dispatch'

I don't know if that's expected, but I'd very much like a way around it.

(Use case: run a workflow if particular files change, or if manually requested)

@TannerGilbert
Copy link

This action only supports pull requests or push's commits and therefore can't be triggered manually, as can be seen in the following code:

switch (eventName) {
case 'pull_request':
base = context.payload.pull_request?.base?.sha
head = context.payload.pull_request?.head?.sha
break
case 'push':
base = context.payload.before
head = context.payload.after
break
default:
core.setFailed(
`This action only supports pull requests and pushes, ${context.eventName} events are not supported. ` +
"Please submit an issue on this action's GitHub repo if you believe this in correct."
)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants