escapace/action-context

Emit semantic version, environment, and pull request context outputs from git history and repository metadata.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jul 8, 2026
License
MPL 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: escapace/action-context@00da07da684ab602d763bc018d9ae4c9f85bea1c # v0.14.1

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
context-sourceSelect context source: event (workflow event context) or pr (explicit pull request inputs).noevent
node-versionOptional Node.js version constraint. Combined with package.json and workspace engine constraints; highest minimum version wins.no
pr-head-refOptional PR head ref guard for context-source=pr. When provided and mismatched, action fails with INPUT_INVALID. Rejected in event mode.no""
pr-head-shaOptional PR head SHA guard for context-source=pr. When provided and mismatched, action fails with INPUT_INVALID. Rejected in event mode.no""
pr-numberExplicit PR number used when context-source=pr. Must be a positive integer. Rejected in event mode.no""
tokenGitHub API token for changelog generation, GitHub Pages detection, and pull request data.no${{ github.token }}
trusted-botsNewline-separated list of bot logins trusted as commit authors (e.g., renovate[bot]). Matching is case-insensitive. Empty means no bots are trusted.no""
namedescription
changelogMarkdown changelog generated from conventional commits between the previous tag and the current ref. Non-empty on tag events only.
contextJSON snapshot of all action outputs. Convenience output for passing complete context to downstream jobs or external systems.
environmentDeployment environment: production for release tags, staging for prerelease tags, testing for non-tag events.
github-pagesWhether GitHub Pages is enabled with workflow-based builds.
github-pages-pathRelative path to static assets directory. Set when exactly one workspace package defines a build:github-pages script.
latestWhether the current version is greater than or equal to the highest existing stable semver tag (prerelease tags excluded).
node-versionResolved Node.js version from the action input, package.json engines, or workspace packages.
pr-author-botWhether the PR author is a bot account. False when pull request context is unavailable.
pr-base-refPull request base branch name. Empty when pull request context is unavailable.
pr-checks-clearWhether all status checks are passing. False when pull request context is unavailable.
pr-commits-trustedWhether every pull request commit author is trusted (allowlisted bot with verified signature, or human with verified signature and write/admin permission). False when pull request context is unavailable.
pr-conventional-commitsConventional commit compliance for merge strategy selection. all: title and all commits follow conventional commits (squash or rebase safe). title-only: only PR title follows conventional commits (squash safe). commits-only: only commits follow conventional commits (rebase safe). none: neither follows conventional commits. Defaults to none when pull request context is unavailable.
pr-head-refPull request head branch name. Empty when pull request context is unavailable.
pr-last-commit-age-minuteElapsed full minutes since the latest pull request head commit. `0` when pull request context is unavailable.
pr-merge-state-clearWhether pull request merge state is clear (`CLEAN` or `HAS_HOOKS`). False when pull request context is unavailable.
pr-mergeableWhether the pull request has no merge conflicts (does not check if branch is behind base). False when pull request context is unavailable.
pr-not-draftWhether the pull request is not a draft. False when pull request context is unavailable.
pr-numberPull request number. `0` when pull request context is unavailable.
pr-review-clearWhether reviews do not block merging (no changes requested, no unsatisfied review requirements, and no pending review requests). False when pull request context is unavailable.
prereleaseWhether the version contains prerelease identifiers.
prerelease-identifierFirst prerelease identifier from the version string (for example, "rc" from 1.2.0-rc.1). Empty for release versions.
short-commitAbbreviated commit SHA (7 characters, extended past leading zeros).
versionComputed semantic version derived from git tags and conventional commits.