mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-15 07:16:47 +01:00
852547d0dc
- Add endpoint to list repository action secrets in API routes - Implement `ListActionsSecrets` function to retrieve action secrets from the database - Update Swagger documentation to include the new `/repos/{owner}/{repo}/actions/secrets` endpoint - Add `actions` package import and define new routes for actions, secrets, variables, and runners in `api.go`. - Refactor action-related API functions into `Action` struct methods in `org/action.go` and `repo/action.go`. - Remove `actionAPI` struct and related functions, replacing them with `NewAction()` calls. - Rename `variables.go` to `action.go` in `org` directory. - Delete `runners.go` and `secrets.go` in both `org` and `repo` directories, consolidating their content into `action.go`. - Update copyright year and add new imports in `org/action.go`. - Implement `API` interface in `services/actions/interface.go` for action-related methods. - Remove individual action-related functions and replace them with methods on the `Action` struct in `repo/action.go`. --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Signed-off-by: appleboy <appleboy.tw@gmail.com>
29 lines
915 B
Go
29 lines
915 B
Go
// Copyright 2024 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package actions
|
|
|
|
import "code.gitea.io/gitea/services/context"
|
|
|
|
// API for actions of a repository or organization
|
|
type API interface {
|
|
// ListActionsSecrets list secrets
|
|
ListActionsSecrets(*context.APIContext)
|
|
// CreateOrUpdateSecret create or update a secret
|
|
CreateOrUpdateSecret(*context.APIContext)
|
|
// DeleteSecret delete a secret
|
|
DeleteSecret(*context.APIContext)
|
|
// ListVariables list variables
|
|
ListVariables(*context.APIContext)
|
|
// GetVariable get a variable
|
|
GetVariable(*context.APIContext)
|
|
// DeleteVariable delete a variable
|
|
DeleteVariable(*context.APIContext)
|
|
// CreateVariable create a variable
|
|
CreateVariable(*context.APIContext)
|
|
// UpdateVariable update a variable
|
|
UpdateVariable(*context.APIContext)
|
|
// GetRegistrationToken get registration token
|
|
GetRegistrationToken(*context.APIContext)
|
|
}
|