Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ linters:
- SourceImportAuthor
- Subscription
- UpdateDefaultSetupConfigurationOptions
- WorkflowsPermissionsOpt
# Body type names exempt from the "Options" suffix rule.
# TODO: fix and remove these exceptions.
body-allowed-wrong-names:
Expand Down
2 changes: 1 addition & 1 deletion github/actions_permissions_enterprise.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx co
// GitHub API docs: https://github.com/proxy/docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-enterprise
//
//meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos
func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, body *WorkflowsPermissionsOpt) (*Response, error) {
func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, body WorkflowsPermissionsRequest) (*Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/permissions/fork-pr-workflows-private-repos", enterprise)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion github/actions_permissions_enterprise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ func TestActionsService_UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(t *t
t.Parallel()
client, mux, _ := setup(t)

input := &WorkflowsPermissionsOpt{
input := WorkflowsPermissionsRequest{
RunWorkflowsFromForkPullRequests: true,
SendWriteTokensToWorkflows: new(false),
SendSecretsAndVariables: new(true),
Expand Down
2 changes: 1 addition & 1 deletion github/actions_permissions_orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx
// GitHub API docs: https://github.com/proxy/docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-organization
//
//meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos
func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, body *WorkflowsPermissionsOpt) (*Response, error) {
func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, body WorkflowsPermissionsRequest) (*Response, error) {
u := fmt.Sprintf("orgs/%v/actions/permissions/fork-pr-workflows-private-repos", org)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion github/actions_permissions_orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ func TestActionsService_UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(t
t.Parallel()
client, mux, _ := setup(t)

input := &WorkflowsPermissionsOpt{
input := WorkflowsPermissionsRequest{
RunWorkflowsFromForkPullRequests: true,
SendWriteTokensToWorkflows: new(false),
SendSecretsAndVariables: new(true),
Expand Down
5 changes: 3 additions & 2 deletions github/actions_workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ func (w WorkflowsPermissions) String() string {
return Stringify(w)
}

// WorkflowsPermissionsOpt specifies options for editing workflows permissions in a repository.
type WorkflowsPermissionsOpt struct {
// WorkflowsPermissionsRequest specifies fork pull request workflow settings
// for a repository, organization, or enterprise.
type WorkflowsPermissionsRequest struct {
RunWorkflowsFromForkPullRequests bool `json:"run_workflows_from_fork_pull_requests"`
SendWriteTokensToWorkflows *bool `json:"send_write_tokens_to_workflows,omitempty"`
SendSecretsAndVariables *bool `json:"send_secrets_and_variables,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion github/repos_actions_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.C
// GitHub API docs: https://github.com/proxy/docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-a-repository
//
//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos
func (s *RepositoriesService) UpdatePrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string, body *WorkflowsPermissionsOpt) (*Response, error) {
func (s *RepositoriesService) UpdatePrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string, body WorkflowsPermissionsRequest) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/permissions/fork-pr-workflows-private-repos", owner, repo)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion github/repos_actions_permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func TestRepositoriesService_UpdatePrivateRepoForkPRWorkflowSettings(t *testing.
t.Parallel()
client, mux, _ := setup(t)

input := &WorkflowsPermissionsOpt{
input := WorkflowsPermissionsRequest{
RunWorkflowsFromForkPullRequests: true,
SendWriteTokensToWorkflows: new(false),
SendSecretsAndVariables: new(true),
Expand Down
Loading