git

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package git provides utilities to interact with git.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChangeTree

func GetChangeTree(ctx context.Context, repoPath, ref, token, base string) (tree.Tree, error)

GetChangeTree returns the ref for the given event name. it is based on https://github.com/dorny/paths-filter/blob/4067d885736b84de7c414f582ac45897079b0a78/src/main.ts#L36

func GetHead

func GetHead(repo *git.Repository, ghContext *actionscore.Context, head string) (string, error)

GetHead gets the head of the current branch. it attempts to mirror the logic of https://github.com/dorny/paths-filter/blob/0ef5f0d812dc7b631d69e07d2491d70fcebc25c8/src/main.ts#L104

Types

type EventType

type EventType uint8

EventType is the type of github api event.

const (
	// EventPullRequest is a pull request event.
	EventPullRequest EventType = iota // pull_request
	// EventPush is a push event.
	EventPush // push
	// EventRelease is a release event.
	EventRelease // release
	// EventTag is a tag event.
	EventTag // tag
	// EventPullRequestReview is a pull request review event.
	EventPullRequestReview // pull_request_review
	// EventPullRequestReviewComment is a pull request review comment event.
	EventPullRequestReviewComment // pull_request_review_comment
	// EventPullRequestTarget is a pull request target event.
	EventPullRequestTarget // pull_request_target
	// EventIssueComment is an issue comment event.
	EventIssueComment // issue_comment
	// EventIssues is an issues event.
	EventIssues // issues
	// EventCreate is a create event.
	EventCreate // create
	// EventDelete is a delete event.
	EventDelete // delete
	// EventDeployment is a deployment event.
	EventDeployment // deployment
)

func (EventType) String

func (i EventType) String() string

Jump to

Keyboard shortcuts

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