scorecard

package
v0.0.0-...-0c0901e Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package scorecard handles sharing a Scorecard githubrepo client across multiple Allstar policies. The Allstar policy interface does not handle passing a reference to this, so we will store a master state here and look it up each time. We don't want to keep the tarball around forever, or we will run out of disk space. This is intended to be setup once for a repo, then all policies run, then closed for that repo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(fullRepo string)

Function Close will close the scorecard clients. This cleans up the downloaded tarball.

Types

type ScClient

type ScClient struct {
	ScRepo       clients.Repo
	ScRepoClient clients.RepoClient
	// contains filtered or unexported fields
}

Type ScClient is returned from Get. It contains the clients needed to call scorecard checks.

func Get

func Get(ctx context.Context, fullRepo string, local bool, tr http.RoundTripper) (*ScClient, error)

Function Get will get the scorecard clients and create them if they don't exist. The github repo is initialized, which means the tarball is downloaded. If local is set, a local copy of the repo will be used instead, this allows for branch changes without another scorecard repo download.

func (ScClient) FetchBranches

func (scc ScClient) FetchBranches() ([]string, error)

Fetch branches from the local repo (used for workflow rule checking).

func (ScClient) GetDefaultBranchName

func (scc ScClient) GetDefaultBranchName() (string, error)

Fetch default branch name from repo.

func (ScClient) SwitchLocalBranch

func (scc ScClient) SwitchLocalBranch(branchName string) error

Switch the local repo between branches.

Jump to

Keyboard shortcuts

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