actions

package
v1.22.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 44 Imported by: 4

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 added in v1.21.0

func Cleanup(taskCtx context.Context, olderThan time.Duration) error

Cleanup removes expired actions logs, data and artifacts

func CleanupArtifacts added in v1.21.0

func CleanupArtifacts(taskCtx context.Context) error

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

func CreateAuthorizationToken added in v1.22.0

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 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 string) (*actions_model.ActionVariable, error)

func DeleteVariableByID added in v1.22.0

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

func DeleteVariableByName added in v1.22.0

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

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 EmitJobsIfReady

func EmitJobsIfReady(runID int64) error

func GetAllRerunJobs added in v1.21.9

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

func GetVariable added in v1.22.0

func Init

func Init()

func NewNotifier

func NewNotifier() notify_service.Notifier

NewNotifier create a new actionsNotifier notifier

func ParseAuthorizationToken added in v1.22.0

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

func StartScheduleTasks added in v1.21.0

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 UpdateVariable added in v1.22.0

func UpdateVariable(ctx context.Context, variableID int64, name, data string) (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)
}

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