github

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Options Options
	// contains filtered or unexported fields
}

Backend implemets the GitHub sourcetool backend

func New

func New() *Backend

func (*Backend) CheckWorkflowFork

func (b *Backend) CheckWorkflowFork(r *models.Repository) error

CheckWorkflowFork verifies that the user has a fork of the repository we are configuring.

func (*Backend) ConfigureControls

func (b *Backend) ConfigureControls(r *models.Repository, branches []*models.Branch, configs []models.ControlConfiguration) error

ConfigureControls configure the SLSA controls in the repository

func (*Backend) ControlConfigurationDescr

func (b *Backend) ControlConfigurationDescr(branch *models.Branch, config models.ControlConfiguration) string

func (*Backend) ControlPrecheck

func (b *Backend) ControlPrecheck(
	r *models.Repository, branches []*models.Branch, config models.ControlConfiguration,
) (ok bool, remediationMessage string, remediateFn models.ControlPreRemediationFn, err error)

ControlPrecheck checks if the prerequisites to enable the controls are OK

func (*Backend) CreateRepoRuleset

func (b *Backend) CreateRepoRuleset(r *models.Repository, branches []*models.Branch) error

func (*Backend) CreateTagRuleset

func (b *Backend) CreateTagRuleset(r *models.Repository) error

func (*Backend) CreateWorkflowPR

func (b *Backend) CreateWorkflowPR(r *models.Repository, branches []*models.Branch) (*models.PullRequest, error)

CreateWorkflowPR creates the pull request to add the provenance workflow to the specified repository.

func (*Backend) FindWorkflowPR

func (b *Backend) FindWorkflowPR(ctx context.Context, r *models.Repository) (*models.PullRequest, error)

func (*Backend) GetBranchControls

func (b *Backend) GetBranchControls(ctx context.Context, r *models.Repository, branch *models.Branch) (*slsa.ControlSetStatus, error)

func (*Backend) GetBranchControlsAtCommit

func (b *Backend) GetBranchControlsAtCommit(ctx context.Context, r *models.Repository, branch *models.Branch, commit *models.Commit) (*slsa.ControlSetStatus, error)

GetBranchControlsAtCommit

func (*Backend) GetLatestCommit

func (b *Backend) GetLatestCommit(ctx context.Context, r *models.Repository, branch *models.Branch) (*models.Commit, error)

GetLatestCommit returns the latest commit from a branch

func (*Backend) GetTagControls

func (b *Backend) GetTagControls(context.Context, *models.Tag) (*slsa.Controls, error)

type Options

type Options struct {
	UseFork bool
}

Jump to

Keyboard shortcuts

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