actions

package
v0.0.0-...-bb05487 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GithubEventPullRequest              = "pull_request"
	GithubEventPullRequestTarget        = "pull_request_target"
	GithubEventPullRequestReviewComment = "pull_request_review_comment"
	GithubEventPullRequestReview        = "pull_request_review"
	GithubEventRegistryPackage          = "registry_package"
	GithubEventCreate                   = "create"
	GithubEventDelete                   = "delete"
	GithubEventFork                     = "fork"
	GithubEventPush                     = "push"
	GithubEventIssues                   = "issues"
	GithubEventIssueComment             = "issue_comment"
	GithubEventRelease                  = "release"
	GithubEventPullRequestComment       = "pull_request_comment"
	GithubEventGollum                   = "gollum"
	GithubEventSchedule                 = "schedule"
)
View Source
const (
	MaxLineSize = 64 * 1024
	DBFSPrefix  = "actions_log/"
)

Variables

This section is empty.

Functions

func DetectWorkflows

func DetectWorkflows(
	gitRepo *git.Repository,
	commit *git.Commit,
	triggedEvent webhook_module.HookEventType,
	payload api.Payloader,
	detectSchedule bool,
) ([]*DetectedWorkflow, []*DetectedWorkflow, error)

func DownloadArtifactV4

func DownloadArtifactV4(ctx *context.Base, art *actions_model.ActionArtifact) error

func DownloadArtifactV4ReadStorage

func DownloadArtifactV4ReadStorage(ctx *context.Base, art *actions_model.ActionArtifact) error

func DownloadArtifactV4ServeDirect

func DownloadArtifactV4ServeDirect(ctx *context.Base, art *actions_model.ActionArtifact) bool

func FormatLog

func FormatLog(timestamp time.Time, content string) string

func FullSteps

FullSteps returns steps with "Set up job" and "Complete job"

func GetArtifactV4ServeDirectURL

func GetArtifactV4ServeDirectURL(art *actions_model.ActionArtifact, method string) (string, error)

func GetContentFromEntry

func GetContentFromEntry(entry *git.TreeEntry) ([]byte, error)

func GetEventsFromContent

func GetEventsFromContent(content []byte) ([]*jobparser.Event, error)

func IsArtifactV4

func IsArtifactV4(art *actions_model.ActionArtifact) bool

IsArtifactV4 detects whether the artifact is likely from v4. V4 backend stores the files as a single combined zip file per artifact, and ensures ContentEncoding contains a slash (otherwise this uses application/zip instead of the custom mime type), which is not the case for the old backend.

func IsDefaultBranchWorkflow

func IsDefaultBranchWorkflow(triggedEvent webhook_module.HookEventType) bool

IsDefaultBranchWorkflow returns true if the event only triggers workflows on the default branch

func IsWorkflow

func IsWorkflow(path string) bool

func ListWorkflows

func ListWorkflows(commit *git.Commit) (string, git.Entries, error)

func OpenLogs

func OpenLogs(ctx context.Context, inStorage bool, filename string) (io.ReadSeekCloser, error)

func ParseLog

func ParseLog(in string) (time.Time, string, error)

func ReadLogs

func ReadLogs(ctx context.Context, inStorage bool, filename string, offset, limit int64) ([]*runnerv1.LogRow, error)

func RemoveLogs

func RemoveLogs(ctx context.Context, inStorage bool, filename string) error

func TransferLogs

func TransferLogs(ctx context.Context, filename string) (func(), error)

TransferLogs transfers logs from DBFS to object storage. It happens when the file is complete and no more logs will be appended. It respects the file format in the filename like ".zst", and compresses the content if needed. The task log file must be marked as "log_in_storage=true" after the transfer.

func WriteLogs

func WriteLogs(ctx context.Context, filename string, offset int64, rows []*runnerv1.LogRow) ([]int, error)

WriteLogs appends logs to DBFS file for temporary storage. It doesn't respect the file format in the filename like ".zst", since it's difficult to reopen a closed compressed file and append new content. Why doesn't it store logs in object storage directly? Because it's not efficient to append content to object storage.

Types

type DetectedWorkflow

type DetectedWorkflow struct {
	EntryName    string
	TriggerEvent *jobparser.Event
	Content      []byte
}

func DetectScheduledWorkflows

func DetectScheduledWorkflows(gitRepo *git.Repository, commit *git.Commit) ([]*DetectedWorkflow, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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