githubactions

package
v0.0.0-...-3a364f3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGithubWorkflowRun

func GetGithubWorkflowRun(repositoryPath string, runId string) (*github.WorkflowRun, *github.Workflow, error)

GetGithubWorkflowRun retrieves a GitHub workflow run and its associated workflow for a given repository path and run ID. It returns the resulting GitHub workflow run and workflow objects, along with an error, if any.

The function requires a valid GitHub access token to be set in the GITHUB_TOKEN environment variable.

Parameters:

  • repositoryPath: The repository path should be in the format "owner/repo"
  • runId: a string representation of the numeric run ID for the workflow

Returns:

  • *github.WorkflowRun: A pointer to the retrieved GitHub workflow run object.
  • *github.Workflow: A pointer to the retrieved GitHub workflow object associated with the workflow run.
  • error: An error value, if any.

func ParseGithubEvent

func ParseGithubEvent(eventType string, eventFile string) (interface{}, error)

ParseGithubEvent reads a JSON file containing a GitHub event

Parameters:

  • eventType: the GitHub event type
  • eventFile: the GitHub event json file

Returns:

  • github.Event: A struct representing the parsed GitHub event.
  • error: An error value, if any. If an error occurs while reading or parsing the file, it will be returned along with an informative error message.

Types

type Normalizer

type Normalizer struct {
	// contains filtered or unexported fields
}

Normalizer is the implementation of the normalizer

func NewNormalizer

func NewNormalizer() Normalizer

NewNormalizer gets a instance of the normalizer

func (Normalizer) Check

func (n Normalizer) Check(env map[string]string) bool

Check if this package can handle the current environment

func (Normalizer) Denormalize

func (n Normalizer) Denormalize(spec ncispec.NormalizeCISpec) map[string]string

func (Normalizer) GetName

func (n Normalizer) GetName() string

GetName returns the name of the normalizer

func (Normalizer) GetSlug

func (n Normalizer) GetSlug() string

GetSlug returns the slug of the normalizer

func (Normalizer) Normalize

func (n Normalizer) Normalize(env map[string]string) ncispec.NormalizeCISpec

Normalize normalizes the environment variables into the common format

Jump to

Keyboard shortcuts

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