gha

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gha provides functions to interact with the GitHub Actions runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InGitHubActions

func InGitHubActions() bool

InGitHubActions indicates whether this application is being run within the GitHub Actions environment.

func PopulateFromInputs

func PopulateFromInputs(v interface{}) (err error)

PopulateFromInputs will populate the given struct with inputs supplied by the GitHub Actions environment. Fields that should be populated must be tagged with `gha:"<name of input>"`. If the empty string is given (`gha:""`) the field name will be used as input key.

Additional options can be supplied through the tags, separated by comma's:

  • required: returns an error if the input is not present or empty string

Example struct:

type Example struct {
    RunID     string `gha:"run-id,required"`
    Directory string `gha:""`
    DryRun    bool   `gha:"dry-run"`
}

func WriteOutput

func WriteOutput(name, value string)

WriteOutput writes an output parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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