Documentation
¶
Overview ¶
Package actions is a set of utilities to help write GitHub Actions code, in particular for parsing inputs and reading the `${{ github }}` context outside of a workflow.
Index ¶
- func DurationInput(action *githubactions.Action, name string) (time.Duration, error)
- func EventName(action *githubactions.Action) string
- func PullRequestEvent(action *githubactions.Action) (*github.PullRequestEvent, error)
- func Repository(action *githubactions.Action) string
- func RootURL(action *githubactions.Action) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationInput ¶
DurationInput parses GitHub Actions inputs that are intended to be a `time.Duration`.
func EventName ¶
func EventName(action *githubactions.Action) string
EventName returns the `${{ github.event_name }}` context value.
func PullRequestEvent ¶
func PullRequestEvent(action *githubactions.Action) (*github.PullRequestEvent, error)
PullRequestEvent parses the `${{ github.event }}` from the filesystem. Since actions code doesn't have direct access to the `${{ github }}` context, the `GITHUB_EVENT_PATH` environment variable is used to read the event. If the `${{ github.event_name }}` is **not** pull request, this will fail.
func Repository ¶
func Repository(action *githubactions.Action) string
Repository returns the `${{ github.repository }}` context value.
func RootURL ¶
func RootURL(action *githubactions.Action) string
RootURL returns the `${{ github.api_url }}` context value. For public GitHub this is expected to be `https://api.github.com` and for GitHub Enterprise it is expected to be `https://[hostname]/api/v3`.
Types ¶
This section is empty.