input

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package input provides mechanisms for fetching type safe input from a GitHub Action.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(name string) (bool, error)

Bool gets the boolean value of an actions input variable.

Specifically Bool supports:

true | True | TRUE | false | False | FALSE

If the variable is not defined, or if the value is not in the supported list, an error is returned.

func Float

func Float(name string) (float64, error)

Float gets the float value of an actions input variable.

If the variable is not defined, or if the value is not a valid float, an error is returned.

func Get

func Get(name string) (value string, ok bool)

Get gets the value of an actions input variable.

It returns the string value of the variable (stripped of any leading and trailing whitespace) and a boolean which indicates whether it was defined.

func Int

func Int(name string) (int, error)

Int gets the integer value of an actions input variable.

If the variable is not defined, or if the value is not a valid integer, an error is returned.

func Lines

func Lines(name string) ([]string, error)

Lines gets the values of a multiline actions input variable.

Each line is stripped of any leading or trailing whitespace prior to returning.

If the variable is not defined, or the input is malformed, an error will be returned.

func List

func List(name string) ([]string, error)

List fetches input given as a list of comma-separated or line-separated values.

Each item is stripped of any leading or trailing whitespace prior to returning.

If the variable is not defined, or if the value is malformed, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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