-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
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
| // 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, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error) { | |
| u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) | |
| return s.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, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error) { | |
| u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) | |
| return s.createWorkflowDispatchEvent(ctx, u, &event) | |
| } | |
| func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url string, event *CreateWorkflowDispatchEventRequest) (*Response, error) { | |
| req, err := s.client.NewRequest("POST", url, event) | |
| if err != nil { | |
| return nil, err | |
| } | |
| return s.client.Do(ctx, req, nil) | |
| } |
Reactions are currently unavailable