-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: Add private repo workflows permission API support #3679
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
Changes from 8 commits
155da37
8ec23fb
7e85478
053462c
a864e95
af079dc
9e8e913
0c11edd
c4d4fea
160ae72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -693,3 +693,84 @@ func TestActionsService_RemoveRepositorySelfHostedRunnersAllowedInOrganization(t | |||||
return client.Actions.RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx, "o", 123) | ||||||
}) | ||||||
} | ||||||
|
||||||
func TestActionsService_GetPrivateRepoForkPRWorkflowSettingsInOrganization(t *testing.T) { | ||||||
t.Parallel() | ||||||
client, mux, _ := setup(t) | ||||||
|
||||||
mux.HandleFunc("/orgs/o/actions/permissions/fork-pr-workflows-private-repos", func(w http.ResponseWriter, r *http.Request) { | ||||||
testMethod(t, r, "GET") | ||||||
fmt.Fprint(w, `{"run_workflows_from_fork_pull_requests": true, "send_write_tokens_to_workflows": false, "send_secrets_and_variables": true, "require_approval_for_fork_pr_workflows": false}`) | ||||||
}) | ||||||
|
||||||
ctx := context.Background() | ||||||
permissions, _, err := client.Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx, "o") | ||||||
if err != nil { | ||||||
t.Errorf("Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization returned error: %v", err) | ||||||
} | ||||||
want := &WorkflowsPermissions{ | ||||||
RunWorkflowsFromForkPullRequests: Ptr(true), | ||||||
SendWriteTokensToWorkflows: Ptr(false), | ||||||
SendSecretsAndVariables: Ptr(true), | ||||||
RequireApprovalForForkPRWorkflows: Ptr(false), | ||||||
} | ||||||
if !cmp.Equal(permissions, want) { | ||||||
t.Errorf("Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization returned %+v, want %+v", permissions, want) | ||||||
} | ||||||
|
||||||
const methodName = "GetPrivateRepoForkPRWorkflowSettingsInOrganization" | ||||||
testBadOptions(t, methodName, func() (err error) { | ||||||
_, _, err = client.Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx, "\n") | ||||||
return err | ||||||
}) | ||||||
|
||||||
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { | ||||||
got, resp, err := client.Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx, "o") | ||||||
if got != nil { | ||||||
t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) | ||||||
} | ||||||
return resp, err | ||||||
}) | ||||||
} | ||||||
|
||||||
func TestActionsService_EditPrivateRepoForkPRWorkflowSettingsInOrganization(t *testing.T) { | ||||||
|
func TestActionsService_EditPrivateRepoForkPRWorkflowSettingsInOrganization(t *testing.T) { | |
func TestActionsService_UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I fix it. Thank you!
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.