Runs one or more shell commands and passes only when every configured command exits successfully.
This plugin is distributed as the standalone Go binary semrel-plugin-condition-generic. Semrel executes the binary as a subprocess, provides plugin configuration through SEMREL_PLUGIN_* environment variables, provides release context through SEMREL_* environment variables, reads standard output, and treats exit code 0 as success and any non-zero exit code as failure. Install the binary in ~/.semrel/plugins/ or anywhere on your $PATH.
go install github.com/SemRels/condition-generic/cmd/plugin@latestPre-built, multi-platform images (linux/amd64, linux/arm64) are published to the GitHub Container Registry on every release:
docker pull ghcr.io/semrels/condition-generic:latestImages are signed with cosign and include a full SBOM attestation. Verify the signature:
cosign verify ghcr.io/semrels/condition-generic:latest \
--certificate-identity-regexp 'https://github.com/SemRels/condition-generic/.github/workflows/release.yml.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.complugins:
- name: condition-generic
path: ~/.semrel/plugins/semrel-plugin-condition-generic
env:
SEMREL_PLUGIN_COMMAND: |
test -f .github/workflows/release.yml
git diff --quiet HEAD| Name | Required | Description | Default |
|---|---|---|---|
SEMREL_PLUGIN_COMMAND |
Primary, required if not using env-var mode | One or more newline-separated shell commands. Each non-empty line is executed independently via sh -c, and all commands must exit with status 0 for the condition to pass. |
None |
SEMREL_PLUGIN_ENV_VAR |
Legacy, optional | Environment variable name to compare for backward-compatible equality checks. Used only when SEMREL_PLUGIN_COMMAND is not set. |
None |
SEMREL_PLUGIN_ENV_VALUE |
Legacy, optional | Expected value for SEMREL_PLUGIN_ENV_VAR. Used only when SEMREL_PLUGIN_COMMAND is not set. |
Empty string |
This plugin does not consume any SEMREL_* release context variables directly.
Semrel executes each configured command before releasing. If every non-empty command line exits with 0 the pipeline continues; otherwise the release is blocked at the first failing command. For backward compatibility, if SEMREL_PLUGIN_COMMAND is not configured, the plugin falls back to comparing SEMREL_PLUGIN_ENV_VAR against SEMREL_PLUGIN_ENV_VALUE.
Apache-2.0