actions

package
v0.0.0-...-8fc6f8c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelAbandonedJobs

func CancelAbandonedJobs(ctx context.Context) error

CancelAbandonedJobs cancels the jobs which have waiting status, but haven't been picked by a runner for a long time

func Cleanup

func Cleanup(ctx context.Context) error

Cleanup removes expired actions logs, data and artifacts

func CleanupArtifacts

func CleanupArtifacts(taskCtx context.Context) error

CleanupArtifacts removes expired add need-deleted artifacts and set records expired status

func CleanupLogs

func CleanupLogs(ctx context.Context) error

CleanupLogs removes logs which are older than the configured retention time

func CreateAuthorizationToken

func CreateAuthorizationToken(taskID, runID, jobID int64) (string, error)

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

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

func CreateVariable(ctx context.Context, ownerID, repoID int64, name, data string) (*actions_model.ActionVariable, error)

func DeleteVariableByID

func DeleteVariableByID(ctx context.Context, variableID int64) error

func DeleteVariableByName

func DeleteVariableByName(ctx context.Context, ownerID, repoID int64, name string) error

func DetectAndHandleSchedules

func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error

DetectAndHandleSchedules detects the schedule workflows on the default branch and create schedule tasks

func EmitJobsIfReady

func EmitJobsIfReady(runID int64) error

func GetAllRerunJobs

GetAllRerunJobs get all jobs that need to be rerun when job should be rerun

func Init

func Init()

func NewNotifier

func NewNotifier() notify_service.Notifier

NewNotifier create a new actionsNotifier notifier

func ParseAuthorizationToken

func ParseAuthorizationToken(req *http.Request) (int64, error)

func StartScheduleTasks

func StartScheduleTasks(ctx context.Context) error

StartScheduleTasks start the task

func StopEndlessTasks

func StopEndlessTasks(ctx context.Context) error

StopEndlessTasks stops the tasks which have running status and continuous updates, but don't end for a long time

func StopZombieTasks

func StopZombieTasks(ctx context.Context) error

StopZombieTasks stops the task which have running status, but haven't been updated for a long time

func TokenToTaskID

func TokenToTaskID(token string) (int64, error)

TokenToTaskID returns the TaskID associated with the provided JWT token

func UpdateVariable

func UpdateVariable(ctx context.Context, variableID int64, name, data string) (bool, error)

Types

type API

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)
}

API for actions of a repository or organization

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL