| // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. |
| // |
| // GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event |
| // |
| //meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches |
| func (s*ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repostring, workflowIDint64, eventCreateWorkflowDispatchEventRequest) (*Response, error) { |
| u:=fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) |
| |
| returns.createWorkflowDispatchEvent(ctx, u, &event) |
| } |
| |
| // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. |
| // |
| // GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event |
| // |
| //meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches |
| func (s*ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileNamestring, eventCreateWorkflowDispatchEventRequest) (*Response, error) { |
| u:=fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) |
| |
| returns.createWorkflowDispatchEvent(ctx, u, &event) |
| } |
| |
| func (s*ActionsService) createWorkflowDispatchEvent(ctx context.Context, urlstring, event*CreateWorkflowDispatchEventRequest) (*Response, error) { |
| req, err:=s.client.NewRequest("POST", url, event) |
| iferr!=nil { |
| returnnil, err |
| } |
| |
| returns.client.Do(ctx, req, nil) |
| } |
GitHub announced, When you trigger a workflow using the GitHub Actions workflow dispatch API endpoint, you’ll now have the option to receive metadata in the response that helps you map your request to the corresponding workflow run.
Affected method -
go-github/github/actions_workflows.go
Lines 189 to 218 in c02c318