Skip to content
Open
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
6 changes: 3 additions & 3 deletions github/actions_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ type EncryptedSecret struct {
SelectedRepositoryIDs SelectedRepoIDs `json:"selected_repository_ids,omitempty"`
}

// OrgSecretRequest represents a request to create or update a secret for an
// SecretOrgRequest represents a request to create or update a secret for an
// organization.
//
// The value of EncryptedValue must be your secret, encrypted with
// LibSodium (see documentation here: https://libsodium.gitbook.io/doc/bindings_for_other_languages)
// using the public key retrieved using the GetPublicKey method.
type OrgSecretRequest struct {
type SecretOrgRequest struct {
KeyID string `json:"key_id"`
EncryptedValue string `json:"encrypted_value"`
Visibility string `json:"visibility"`
Expand Down Expand Up @@ -341,7 +341,7 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re
// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret
//
//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}
func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org, name string, body OrgSecretRequest) (*Response, error) {
func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org, name string, body SecretOrgRequest) (*Response, error) {
u := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name)

req, err := s.client.NewRequest(ctx, "PUT", u, body)
Expand Down
4 changes: 2 additions & 2 deletions github/actions_secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func TestActionsService_CreateOrUpdateOrgSecret(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

input := OrgSecretRequest{
input := SecretOrgRequest{
KeyID: "1234",
EncryptedValue: "QIv=",
Visibility: "selected",
Expand All @@ -482,7 +482,7 @@ func TestActionsService_CreateOrUpdateOrgSecret(t *testing.T) {
mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "PUT")
testHeader(t, r, "Content-Type", "application/json")
want := OrgSecretRequest{
want := SecretOrgRequest{
KeyID: "1234",
EncryptedValue: "QIv=",
Visibility: "selected",
Expand Down
28 changes: 14 additions & 14 deletions github/actions_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ import (
"fmt"
)

// OrgActionsVariableCreateRequest represents a request to create an
// ActionsCreateOrgVariableRequest represents a request to create an
// organization variable.
type OrgActionsVariableCreateRequest struct {
type ActionsCreateOrgVariableRequest struct {
Name string `json:"name"`
Value string `json:"value"`
Visibility string `json:"visibility"`
SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitzero"`
}

// OrgActionsVariableUpdateRequest represents a request to update an
// ActionsUpdateOrgVariableRequest represents a request to update an
// organization variable.
type OrgActionsVariableUpdateRequest struct {
type ActionsUpdateOrgVariableRequest struct {
Name *string `json:"name,omitempty"`
Value *string `json:"value,omitempty"`
Visibility *string `json:"visibility,omitempty"`
SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitzero"`
}

// ActionsVariableCreateRequest represents a request to create a variable
// ActionsCreateVariableRequest represents a request to create a variable
// for a repository or repository environment variable.
type ActionsVariableCreateRequest struct {
type ActionsCreateVariableRequest struct {
Name string `json:"name"`
Value string `json:"value"`
}

// ActionsVariableUpdateRequest represents a request to update a variable
// ActionsUpdateVariableRequest represents a request to update a variable
// for a repository or repository environment variable.
type ActionsVariableUpdateRequest struct {
type ActionsUpdateVariableRequest struct {
Name *string `json:"name,omitempty"`
Value *string `json:"value,omitempty"`
}
Expand Down Expand Up @@ -236,7 +236,7 @@ func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, v
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable
//
//meta:operation POST /repos/{owner}/{repo}/actions/variables
func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, body ActionsVariableCreateRequest) (*Response, error) {
func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, body ActionsCreateVariableRequest) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo)

req, err := s.client.NewRequest(ctx, "POST", u, body)
Expand All @@ -252,7 +252,7 @@ func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo str
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable
//
//meta:operation POST /orgs/{org}/actions/variables
func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, body OrgActionsVariableCreateRequest) (*Response, error) {
func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, body ActionsCreateOrgVariableRequest) (*Response, error) {
u := fmt.Sprintf("orgs/%v/actions/variables", org)

req, err := s.client.NewRequest(ctx, "POST", u, body)
Expand All @@ -268,7 +268,7 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, body
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable
//
//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/variables
func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, body ActionsVariableCreateRequest) (*Response, error) {
func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, body ActionsCreateVariableRequest) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/environments/%v/variables", owner, repo, env)

req, err := s.client.NewRequest(ctx, "POST", u, body)
Expand All @@ -283,7 +283,7 @@ func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable
//
//meta:operation PATCH /repos/{owner}/{repo}/actions/variables/{name}
func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo, name string, body ActionsVariableUpdateRequest) (*Response, error) {
func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo, name string, body ActionsUpdateVariableRequest) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name)

req, err := s.client.NewRequest(ctx, "PATCH", u, body)
Expand All @@ -299,7 +299,7 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo, na
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-organization-variable
//
//meta:operation PATCH /orgs/{org}/actions/variables/{name}
func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org, name string, body OrgActionsVariableUpdateRequest) (*Response, error) {
func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org, name string, body ActionsUpdateOrgVariableRequest) (*Response, error) {
u := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name)

req, err := s.client.NewRequest(ctx, "PATCH", u, body)
Expand All @@ -315,7 +315,7 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org, name string
// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable
//
//meta:operation PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}
func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env, name string, body ActionsVariableUpdateRequest) (*Response, error) {
func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env, name string, body ActionsUpdateVariableRequest) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, name)

req, err := s.client.NewRequest(ctx, "PATCH", u, body)
Expand Down
12 changes: 6 additions & 6 deletions github/actions_variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestActionsService_CreateRepoVariable(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

input := ActionsVariableCreateRequest{
input := ActionsCreateVariableRequest{
Name: "NAME",
Value: "VALUE",
}
Expand Down Expand Up @@ -177,7 +177,7 @@ func TestActionsService_UpdateRepoVariable(t *testing.T) {
client, mux, _ := setup(t)

name := "NAME"
input := ActionsVariableUpdateRequest{
input := ActionsUpdateVariableRequest{
Name: &name,
Value: Ptr("VALUE"),
}
Expand Down Expand Up @@ -321,7 +321,7 @@ func TestActionsService_CreateOrgVariable(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

input := OrgActionsVariableCreateRequest{
input := ActionsCreateOrgVariableRequest{
Name: "NAME",
Value: "VALUE",
Visibility: "selected",
Expand Down Expand Up @@ -357,7 +357,7 @@ func TestActionsService_UpdateOrgVariable(t *testing.T) {
client, mux, _ := setup(t)

name := "NAME"
input := OrgActionsVariableUpdateRequest{
input := ActionsUpdateOrgVariableRequest{
Name: &name,
Value: Ptr("VALUE"),
Visibility: Ptr("selected"),
Expand Down Expand Up @@ -642,7 +642,7 @@ func TestActionsService_CreateEnvVariable(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

input := ActionsVariableCreateRequest{
input := ActionsCreateVariableRequest{
Name: "NAME",
Value: "VAR",
}
Expand Down Expand Up @@ -676,7 +676,7 @@ func TestActionsService_UpdateEnvVariable(t *testing.T) {
client, mux, _ := setup(t)

name := "NAME"
input := ActionsVariableUpdateRequest{
input := ActionsUpdateVariableRequest{
Name: &name,
Value: Ptr("VAR"),
}
Expand Down
Loading
Loading