mirror of
https://github.com/go-gitea/gitea
synced 2025-07-10 04:27:22 +00:00
Added Description Field for Secrets and Variables (#33526)
Fixes #33484 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -73,6 +73,33 @@ func TestAPIRepoSecrets(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("CreateWithDescription", func(t *testing.T) {
|
||||
cases := []struct {
|
||||
Name string
|
||||
Description string
|
||||
ExpectedStatus int
|
||||
}{
|
||||
{
|
||||
Name: "no_description",
|
||||
Description: "",
|
||||
ExpectedStatus: http.StatusCreated,
|
||||
},
|
||||
{
|
||||
Name: "description",
|
||||
Description: "some description",
|
||||
ExpectedStatus: http.StatusCreated,
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
req := NewRequestWithJSON(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/actions/secrets/%s", repo.FullName(), c.Name), api.CreateOrUpdateSecretOption{
|
||||
Data: "data",
|
||||
Description: c.Description,
|
||||
}).AddTokenAuth(token)
|
||||
MakeRequest(t, req, c.ExpectedStatus)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Update", func(t *testing.T) {
|
||||
name := "update_secret"
|
||||
url := fmt.Sprintf("/api/v1/repos/%s/actions/secrets/%s", repo.FullName(), name)
|
||||
|
Reference in New Issue
Block a user