Plugin: condition-generic
Runs a shell command and only passes when that command exits with status 0. Use it to gate releases on custom branch checks, repository state, or external validation logic.
Installation
Section titled “Installation”Binary
Section titled “Binary”semrel plugin install @semrel/condition-genericsemrel 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-generic:latestVerify the image signature with cosign:
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.comConfiguration
Section titled “Configuration”version: 1plugins: - uses: @semrel/condition-generic args: command: 'test "$SEMREL_BRANCH" = "main"'Environment Variables
Section titled “Environment Variables”| Name | Required | Default | Description |
|---|---|---|---|
SEMREL_PLUGIN_COMMAND | yes | — | Shell command that must exit with status 0 for the condition to pass. |
Release Context Variables
Section titled “Release Context Variables”The plugin itself only reads SEMREL_PLUGIN_COMMAND, but the command it executes inherits the full SemRel release context:
SEMREL_VERSIONSEMREL_TAG_NAMESEMREL_NEXT_VERSIONSEMREL_CURRENT_VERSIONSEMREL_BUMPSEMREL_BRANCHSEMREL_TAG_PREFIXSEMREL_CHANGELOGSEMREL_DRY_RUN
Behavior
Section titled “Behavior”With command: 'test "$SEMREL_BRANCH" = "main"', the plugin exits 0 on main and exits non-zero on every other branch.