Documentation
¶
Index ¶
- func CancelAbandonedJobs(ctx context.Context) error
- func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, ...) error
- func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository) error
- func Cleanup(ctx context.Context) error
- func CleanupArtifacts(taskCtx context.Context) error
- func CleanupEphemeralRunners(ctx context.Context) error
- func CleanupLogs(ctx context.Context) error
- func CreateAuthorizationToken(taskID, runID, jobID int64) (string, error)
- func CreateCommitStatus(ctx context.Context, jobs ...*actions_model.ActionRunJob)
- func CreateScheduleTask(ctx context.Context, cron *actions_model.ActionSchedule) error
- func CreateVariable(ctx context.Context, ownerID, repoID int64, name, data, description string) (*actions_model.ActionVariable, error)
- func DeleteVariableByID(ctx context.Context, variableID int64) error
- func DeleteVariableByName(ctx context.Context, ownerID, repoID int64, name string) error
- func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error
- func DispatchActionWorkflow(ctx reqctx.RequestContext, doer *user_model.User, repo *repo_model.Repository, ...) error
- func EmitJobsIfReady(runID int64) error
- func EnableOrDisableWorkflow(ctx *context.APIContext, workflowID string, isEnable bool) error
- func FindTaskNeeds(ctx context.Context, job *actions_model.ActionRunJob) (map[string]*TaskNeed, error)
- func GenerateGiteaContext(run *actions_model.ActionRun, job *actions_model.ActionRunJob) map[string]any
- func GetActionWorkflow(ctx *context.APIContext, workflowID string) (*api.ActionWorkflow, error)
- func GetAllRerunJobs(job *actions_model.ActionRunJob, allJobs []*actions_model.ActionRunJob) []*actions_model.ActionRunJob
- func GetVariable(ctx context.Context, opts actions_model.FindVariablesOpts) (*actions_model.ActionVariable, error)
- func Init(ctx context.Context) error
- func ListActionWorkflows(ctx *context.APIContext) ([]*api.ActionWorkflow, error)
- func NewNotifier() notify_service.Notifier
- func ParseAuthorizationToken(req *http.Request) (int64, error)
- func PickTask(ctx context.Context, runner *actions_model.ActionRunner) (*runnerv1.Task, bool, error)
- func StartScheduleTasks(ctx context.Context) error
- func StopEndlessTasks(ctx context.Context) error
- func StopZombieTasks(ctx context.Context) error
- func TokenToTaskID(token string) (int64, error)
- func UpdateVariableNameData(ctx context.Context, variable *actions_model.ActionVariable) (bool, error)
- type API
- type TaskNeed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelAbandonedJobs ¶
CancelAbandonedJobs cancels the jobs which have waiting status, but haven't been picked by a runner for a long time
func CancelPreviousJobs ¶ added in v1.23.6
func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error
func CleanRepoScheduleTasks ¶ added in v1.23.6
func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository) error
func Cleanup ¶ added in v1.21.0
Cleanup removes expired actions logs, data, artifacts and used ephemeral runners
func CleanupArtifacts ¶ added in v1.21.0
CleanupArtifacts removes expired add need-deleted artifacts and set records expired status
func CleanupEphemeralRunners ¶
CleanupEphemeralRunners removes used ephemeral runners which are no longer able to process jobs
func CleanupLogs ¶ added in v1.23.0
CleanupLogs removes logs which are older than the configured retention time
func CreateAuthorizationToken ¶ added in v1.22.0
func CreateCommitStatus ¶
func CreateCommitStatus(ctx context.Context, jobs ...*actions_model.ActionRunJob)
CreateCommitStatus creates a commit status for the given job. It won't return an error failed, but will log it, because it's not critical.
func CreateScheduleTask ¶ added in v1.21.0
func CreateScheduleTask(ctx context.Context, cron *actions_model.ActionSchedule) error
CreateScheduleTask creates a scheduled task from a cron action schedule. It creates an action run based on the schedule, inserts it into the database, and creates commit statuses for each job.
func CreateVariable ¶ added in v1.22.0
func CreateVariable(ctx context.Context, ownerID, repoID int64, name, data, description string) (*actions_model.ActionVariable, error)
func DeleteVariableByID ¶ added in v1.22.0
func DeleteVariableByName ¶ added in v1.22.0
func DetectAndHandleSchedules ¶ added in v1.21.5
func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error
DetectAndHandleSchedules detects the schedule workflows on the default branch and create schedule tasks
func DispatchActionWorkflow ¶
func DispatchActionWorkflow(ctx reqctx.RequestContext, doer *user_model.User, repo *repo_model.Repository, gitRepo *git.Repository, workflowID, ref string, processInputs func(model *model.WorkflowDispatch, inputs map[string]any) error) error
func EmitJobsIfReady ¶
func EnableOrDisableWorkflow ¶
func EnableOrDisableWorkflow(ctx *context.APIContext, workflowID string, isEnable bool) error
func FindTaskNeeds ¶
func FindTaskNeeds(ctx context.Context, job *actions_model.ActionRunJob) (map[string]*TaskNeed, error)
FindTaskNeeds finds the `needs` for the task by the task's job
func GenerateGiteaContext ¶
func GenerateGiteaContext(run *actions_model.ActionRun, job *actions_model.ActionRunJob) map[string]any
GenerateGiteaContext generate the gitea context without token and gitea_runtime_token job can be nil when generating a context for parsing workflow-level expressions
func GetActionWorkflow ¶
func GetActionWorkflow(ctx *context.APIContext, workflowID string) (*api.ActionWorkflow, error)
func GetAllRerunJobs ¶ added in v1.21.9
func GetAllRerunJobs(job *actions_model.ActionRunJob, allJobs []*actions_model.ActionRunJob) []*actions_model.ActionRunJob
GetAllRerunJobs get all jobs that need to be rerun when job should be rerun
func GetVariable ¶ added in v1.22.0
func GetVariable(ctx context.Context, opts actions_model.FindVariablesOpts) (*actions_model.ActionVariable, error)
func ListActionWorkflows ¶
func ListActionWorkflows(ctx *context.APIContext) ([]*api.ActionWorkflow, error)
func NewNotifier ¶
func NewNotifier() notify_service.Notifier
NewNotifier create a new actionsNotifier notifier
func ParseAuthorizationToken ¶ added in v1.22.0
func PickTask ¶ added in v1.23.4
func PickTask(ctx context.Context, runner *actions_model.ActionRunner) (*runnerv1.Task, bool, error)
func StartScheduleTasks ¶ added in v1.21.0
StartScheduleTasks start the task
func StopEndlessTasks ¶
StopEndlessTasks stops the tasks which have running status and continuous updates, but don't end for a long time
func StopZombieTasks ¶
StopZombieTasks stops the task which have running status, but haven't been updated for a long time
func TokenToTaskID ¶ added in v1.22.4
TokenToTaskID returns the TaskID associated with the provided JWT token
func UpdateVariableNameData ¶ added in v1.23.4
func UpdateVariableNameData(ctx context.Context, variable *actions_model.ActionVariable) (bool, error)
Types ¶
type API ¶ added in v1.22.0
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) // CreateRegistrationToken get registration token CreateRegistrationToken(*context.APIContext) // ListRunners list runners ListRunners(*context.APIContext) // GetRunner get a runner GetRunner(*context.APIContext) // DeleteRunner delete runner DeleteRunner(*context.APIContext) }
API for actions of a repository or organization