Skip to content

Commit 479dcfa

Browse files
committed
rename unexported
1 parent 3a70155 commit 479dcfa

5 files changed

Lines changed: 36 additions & 36 deletions

File tree

github/actions_oidc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context,
5656
// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization
5757
//
5858
//meta:operation PUT /orgs/{org}/actions/oidc/customization/sub
59-
func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) {
59+
func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, body *OIDCSubjectClaimCustomTemplate) (*Response, error) {
6060
u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org)
61-
return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template)
61+
return s.setOIDCSubjectClaimCustomTemplate(ctx, u, body)
6262
}
6363

6464
// SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository.

github/actions_secrets.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,41 +246,41 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, body *Encryp
246246
// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret
247247
//
248248
//meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}
249-
func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) {
250-
if eSecret == nil {
249+
func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, body *EncryptedSecret) (*Response, error) {
250+
if body == nil {
251251
return nil, errors.New("encrypted secret must be provided")
252252
}
253253

254-
url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name)
255-
return s.putSecret(ctx, url, eSecret)
254+
url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, body.Name)
255+
return s.putSecret(ctx, url, body)
256256
}
257257

258258
// CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value.
259259
//
260260
// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret
261261
//
262262
//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}
263-
func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) {
264-
if eSecret == nil {
263+
func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, body *EncryptedSecret) (*Response, error) {
264+
if body == nil {
265265
return nil, errors.New("encrypted secret must be provided")
266266
}
267267

268-
url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name)
269-
return s.putSecret(ctx, url, eSecret)
268+
url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, body.Name)
269+
return s.putSecret(ctx, url, body)
270270
}
271271

272272
// CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value.
273273
//
274274
// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#create-or-update-an-environment-secret
275275
//
276276
//meta:operation PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}
277-
func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) {
278-
if eSecret == nil {
277+
func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, body *EncryptedSecret) (*Response, error) {
278+
if body == nil {
279279
return nil, errors.New("encrypted secret must be provided")
280280
}
281281

282-
url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name)
283-
return s.putSecret(ctx, url, eSecret)
282+
url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, body.Name)
283+
return s.putSecret(ctx, url, body)
284284
}
285285

286286
func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Response, error) {

github/actions_variables.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,29 +148,29 @@ func (s *ActionsService) postVariable(ctx context.Context, url string, body *Act
148148
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable
149149
//
150150
//meta:operation POST /repos/{owner}/{repo}/actions/variables
151-
func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) {
151+
func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, body *ActionsVariable) (*Response, error) {
152152
url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo)
153-
return s.postVariable(ctx, url, variable)
153+
return s.postVariable(ctx, url, body)
154154
}
155155

156156
// CreateOrgVariable creates an organization variable.
157157
//
158158
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable
159159
//
160160
//meta:operation POST /orgs/{org}/actions/variables
161-
func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) {
161+
func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, body *ActionsVariable) (*Response, error) {
162162
url := fmt.Sprintf("orgs/%v/actions/variables", org)
163-
return s.postVariable(ctx, url, variable)
163+
return s.postVariable(ctx, url, body)
164164
}
165165

166166
// CreateEnvVariable creates an environment variable.
167167
//
168168
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable
169169
//
170170
//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/variables
171-
func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) {
171+
func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, body *ActionsVariable) (*Response, error) {
172172
url := fmt.Sprintf("repos/%v/%v/environments/%v/variables", owner, repo, env)
173-
return s.postVariable(ctx, url, variable)
173+
return s.postVariable(ctx, url, body)
174174
}
175175

176176
func (s *ActionsService) patchVariable(ctx context.Context, url string, body *ActionsVariable) (*Response, error) {

github/actions_workflows.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,21 +202,21 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor
202202
// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
203203
//
204204
//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
205-
func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {
205+
func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, body CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {
206206
u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID)
207207

208-
return s.createWorkflowDispatchEvent(ctx, u, &event)
208+
return s.createWorkflowDispatchEvent(ctx, u, &body)
209209
}
210210

211211
// CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run.
212212
//
213213
// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
214214
//
215215
//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
216-
func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {
216+
func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, body CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {
217217
u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName)
218218

219-
return s.createWorkflowDispatchEvent(ctx, u, &event)
219+
return s.createWorkflowDispatchEvent(ctx, u, &body)
220220
}
221221

222222
func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url string, body *CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {

github/codespaces_secrets.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret,
187187
// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user
188188
//
189189
//meta:operation PUT /user/codespaces/secrets/{secret_name}
190-
func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) {
191-
if eSecret == nil {
190+
func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, body *EncryptedSecret) (*Response, error) {
191+
if body == nil {
192192
return nil, errors.New("encrypted secret must be provided")
193193
}
194194

195-
u := fmt.Sprintf("user/codespaces/secrets/%v", eSecret.Name)
196-
return s.createOrUpdateSecret(ctx, u, eSecret)
195+
u := fmt.Sprintf("user/codespaces/secrets/%v", body.Name)
196+
return s.createOrUpdateSecret(ctx, u, body)
197197
}
198198

199199
// CreateOrUpdateOrgSecret creates or updates an orgs codespace secret
@@ -203,13 +203,13 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre
203203
// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret
204204
//
205205
//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}
206-
func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) {
207-
if eSecret == nil {
206+
func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, body *EncryptedSecret) (*Response, error) {
207+
if body == nil {
208208
return nil, errors.New("encrypted secret must be provided")
209209
}
210210

211-
u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, eSecret.Name)
212-
return s.createOrUpdateSecret(ctx, u, eSecret)
211+
u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, body.Name)
212+
return s.createOrUpdateSecret(ctx, u, body)
213213
}
214214

215215
// CreateOrUpdateRepoSecret creates or updates a repos codespace secret
@@ -219,13 +219,13 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str
219219
// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret
220220
//
221221
//meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}
222-
func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) {
223-
if eSecret == nil {
222+
func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, body *EncryptedSecret) (*Response, error) {
223+
if body == nil {
224224
return nil, errors.New("encrypted secret must be provided")
225225
}
226226

227-
u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name)
228-
return s.createOrUpdateSecret(ctx, u, eSecret)
227+
u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, body.Name)
228+
return s.createOrUpdateSecret(ctx, u, body)
229229
}
230230

231231
func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string, body *EncryptedSecret) (*Response, error) {

0 commit comments

Comments
 (0)