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”go install github.com/SemRels/condition-generic@latestEach plugin is a standalone Go binary. Keep it on your PATH or reference it with path: in .semrel.yaml. If you keep secrets in a .env file, load them with semrel --env-file .env release.
Configuration
Section titled “Configuration”version: 1plugins: - name: condition-generic path: 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.