Skip to content

Commit daa96df

Browse files
authored
Change the CreateRequiredWorkflow method from PUT to POST (#2771)
Fixes: #2770.
1 parent 85b986d commit daa96df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

github/actions_required_workflows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin
9494
// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow
9595
func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) {
9696
url := fmt.Sprintf("orgs/%v/actions/required_workflows", org)
97-
req, err := s.client.NewRequest("PUT", url, createRequiredWorkflowOptions)
97+
req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions)
9898
if err != nil {
9999
return nil, nil, err
100100
}

github/actions_required_workflows_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) {
8383
client, mux, _, teardown := setup()
8484
defer teardown()
8585
mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) {
86-
testMethod(t, r, "PUT")
86+
testMethod(t, r, "POST")
8787
testHeader(t, r, "Content-Type", "application/json")
8888
testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n")
8989
fmt.Fprint(w, `{

0 commit comments

Comments
 (0)