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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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