Documentation
¶
Overview ¶
Package env provides environment variable handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
Token string // GITHUB_TOKEN
Repository string // GITHUB_REPOSITORY (format: "owner/repo")
Ref string // GITHUB_REF (e.g., "refs/heads/main" or "refs/pull/42/merge")
RefName string // GITHUB_REF_NAME (e.g., "main" or "42/merge")
SHA string // GITHUB_SHA
EventName string // GITHUB_EVENT_NAME (e.g., "pull_request", "push", "release")
BaseRef string // GITHUB_BASE_REF (only set on pull_request events)
EventPath string // GITHUB_EVENT_PATH (path to event JSON file)
Output string // GITHUB_OUTPUT (path to output file)
ServerURL string // GITHUB_SERVER_URL (defaults to "https://github.com")
APIURL string // GITHUB_API_URL (defaults to "https://api.github.com")
RunID string // GITHUB_RUN_ID
Actor string // GITHUB_ACTOR
IsGitHubActions bool // true if GITHUB_ACTIONS == "true"
PRNumber int // extracted from GITHUB_REF; 0 if not a PR
HasToken bool // true if Token != ""
PushPayloadLoaded bool // true when a push event payload was read successfully
PushBefore string // push event before SHA
PushAfter string // push event after SHA
PushCommits []PushCommit // commits listed in the push event payload
}
Context holds all GitHub Actions environment variables. Missing variables produce zero values (degraded mode).
Click to show internal directories.
Click to hide internal directories.