Plugin: condition-github-actions
Confirms the current release is running inside GitHub Actions. Works seamlessly on github.com, GitHub Enterprise Server (GHES), and GitHub Enterprise Cloud with data residency (*.ghe.com).
Installation
Section titled “Installation”Binary
Section titled “Binary”semrel plugin install @semrel/condition-github-actionssemrel plugin install downloads the binary to .semrel/plugins/ and updates .semrel.lock. Commit .semrel.lock to pin the version for your team.
Docker
Section titled “Docker”Pre-built, signed multi-platform images (linux/amd64, linux/arm64) are published on every release:
docker pull ghcr.io/semrels/condition-github-actions:latestVerify the image signature with cosign:
cosign verify ghcr.io/semrels/condition-github-actions:latest \ --certificate-identity-regexp 'https://github.com/SemRels/condition-github-actions/.github/workflows/release.yml.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.comConfiguration
Section titled “Configuration”version: 1plugins: - uses: @semrel/condition-github-actions phase: condition args: branch: mainEnvironment Variables
Section titled “Environment Variables”| Name | Required | Default | Description |
|---|---|---|---|
SEMREL_PLUGIN_BRANCH | no | — | Optional branch name override. When set, requires GITHUB_REF_NAME (or GITHUB_REF stripped of refs/heads/) to match this value. |
GitHub Actions & Enterprise Environment
Section titled “GitHub Actions & Enterprise Environment”| Variable | Required | Description |
|---|---|---|
GITHUB_ACTIONS | yes | Must be "true". |
GITHUB_TOKEN / GH_TOKEN | yes | At least one token variable must be non-empty. |
GITHUB_REF_NAME / GITHUB_REF | no | Checked when SEMREL_PLUGIN_BRANCH is set; automatically falls back to GITHUB_REF (refs/heads/<branch>) on older GHES runners. |
GITHUB_SERVER_URL | no | Optional GitHub server URL (e.g. https://github.com, https://ghe.example.com, or https://octocorp.ghe.com). Validated as an http/https URL when set. |
GITHUB_API_URL | no | Optional GitHub API URL (e.g. https://api.github.com, https://ghe.example.com/api/v3, or https://api.octocorp.ghe.com). Validated as an http/https URL when set. |
Release Context Variables
Section titled “Release Context Variables”This plugin does not require any of the shared SEMREL_* release context variables to do its job.
Behavior
Section titled “Behavior”When GITHUB_ACTIONS=true and a valid token + URL environment is present, the plugin succeeds immediately. Otherwise the condition fails and SemRel stops the pipeline.