Autogenerating parameters in YAML for github action dispatch events #1005
Answered
by
matkoch
MaddoScientisto
asked this question in
Q&A
-
The github actions API allows triggering builds through the API like this: curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/dispatches \
-d '{"ref":"topic-branch","inputs":{"name":"Mona the Octocat","home":"San Francisco, CA"}}' How can these inputs be generated through the yaml generator? [GitHubActions("continuous",
GitHubActionsImage.WindowsServer2022,
InvokedTargets = new[] { nameof(BuildSetup) },
On = new[] { GitHubActionsTrigger.WorkflowDispatch },
EnableGitHubToken = true, OnWorkflowDispatchOptionalInputs = new []{"name", "home"},
)] in the hope that would send that name parameter to the build script but all I get is a very unhelpful error when trying a build and the workflow yml is generated.
How do I generate these parameters properly? |
Beta Was this translation helpful? Give feedback.
Answered by
matkoch
Aug 24, 2022
Replies: 1 comment 2 replies
-
Try executing the command that is shown. I haven't looked into that area for a long time. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
matkoch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try executing the command that is shown. I haven't looked into that area for a long time.