escapace/action-context
Emit semantic version, environment, and pull request context outputs from git history and repository metadata.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jul 8, 2026
- License
- MPL 2.0
Pinned Snippet
uses: escapace/action-context@00da07da684ab602d763bc018d9ae4c9f85bea1c # v0.14.1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| context-source | Select context source: event (workflow event context) or pr (explicit pull request inputs). | no | event |
| node-version | Optional Node.js version constraint. Combined with package.json and workspace engine constraints; highest minimum version wins. | no | — |
| pr-head-ref | Optional PR head ref guard for context-source=pr. When provided and mismatched, action fails with INPUT_INVALID. Rejected in event mode. | no | "" |
| pr-head-sha | Optional PR head SHA guard for context-source=pr. When provided and mismatched, action fails with INPUT_INVALID. Rejected in event mode. | no | "" |
| pr-number | Explicit PR number used when context-source=pr. Must be a positive integer. Rejected in event mode. | no | "" |
| token | GitHub API token for changelog generation, GitHub Pages detection, and pull request data. | no | ${{ github.token }} |
| trusted-bots | Newline-separated list of bot logins trusted as commit authors (e.g., renovate[bot]). Matching is case-insensitive. Empty means no bots are trusted. | no | "" |
Outputs
| name | description |
|---|---|
| changelog | Markdown changelog generated from conventional commits between the previous tag and the current ref. Non-empty on tag events only. |
| context | JSON snapshot of all action outputs. Convenience output for passing complete context to downstream jobs or external systems. |
| environment | Deployment environment: production for release tags, staging for prerelease tags, testing for non-tag events. |
| github-pages | Whether GitHub Pages is enabled with workflow-based builds. |
| github-pages-path | Relative path to static assets directory. Set when exactly one workspace package defines a build:github-pages script. |
| latest | Whether the current version is greater than or equal to the highest existing stable semver tag (prerelease tags excluded). |
| node-version | Resolved Node.js version from the action input, package.json engines, or workspace packages. |
| pr-author-bot | Whether the PR author is a bot account. False when pull request context is unavailable. |
| pr-base-ref | Pull request base branch name. Empty when pull request context is unavailable. |
| pr-checks-clear | Whether all status checks are passing. False when pull request context is unavailable. |
| pr-commits-trusted | Whether 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-commits | Conventional 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-ref | Pull request head branch name. Empty when pull request context is unavailable. |
| pr-last-commit-age-minute | Elapsed full minutes since the latest pull request head commit. `0` when pull request context is unavailable. |
| pr-merge-state-clear | Whether pull request merge state is clear (`CLEAN` or `HAS_HOOKS`). False when pull request context is unavailable. |
| pr-mergeable | Whether the pull request has no merge conflicts (does not check if branch is behind base). False when pull request context is unavailable. |
| pr-not-draft | Whether the pull request is not a draft. False when pull request context is unavailable. |
| pr-number | Pull request number. `0` when pull request context is unavailable. |
| pr-review-clear | Whether reviews do not block merging (no changes requested, no unsatisfied review requirements, and no pending review requests). False when pull request context is unavailable. |
| prerelease | Whether the version contains prerelease identifiers. |
| prerelease-identifier | First prerelease identifier from the version string (for example, "rc" from 1.2.0-rc.1). Empty for release versions. |
| short-commit | Abbreviated commit SHA (7 characters, extended past leading zeros). |
| version | Computed semantic version derived from git tags and conventional commits. |