actions

package
v0.0.0-...-070363a Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationInput

func DurationInput(action *githubactions.Action, name string) (time.Duration, error)

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.

Jump to

Keyboard shortcuts

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