Zum Inhalt springen

Plugin: condition-generic

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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.

Terminal window
go install github.com/SemRels/condition-generic@latest

Each 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.

version: 1
plugins:
- name: condition-generic
path: condition-generic
args:
command: 'test "$SEMREL_BRANCH" = "main"'
NameRequiredDefaultDescription
SEMREL_PLUGIN_COMMANDyesShell command that must exit with status 0 for the condition to pass.

The plugin itself only reads SEMREL_PLUGIN_COMMAND, but the command it executes inherits the full SemRel release context:

  • SEMREL_VERSION
  • SEMREL_TAG_NAME
  • SEMREL_NEXT_VERSION
  • SEMREL_CURRENT_VERSION
  • SEMREL_BUMP
  • SEMREL_BRANCH
  • SEMREL_TAG_PREFIX
  • SEMREL_CHANGELOG
  • SEMREL_DRY_RUN

With command: 'test "$SEMREL_BRANCH" = "main"', the plugin exits 0 on main and exits non-zero on every other branch.