Home

Awesome

:mechanical_arm: hooks-exec

CI Go Report Card PkgGoDev

This plugin allows to execute custom scripts during the semantic-release process.

Usage

Use this plugin by enabling it via --hooks exec.

Configuration

There are two possible scripts that can be executed during the release process: (i) the success script, if the release was successful, and (ii) the no release script, if the was not created for a specific reason.

The scripts are configured via the --hooks-opt exec_on_success="echo v{{.NewRelease.Version}} " and --hooks-opt exec_on_no_release="echo {{.Reason}}" flags. Additionally, they .semrelrc file can be used to configure the scripts:

{
  "plugins": {
    "hooks": {
      "names": [
        "exec"
      ],
      "options": {
        "exec_on_success": "echo v{{.PrevRelease.Version}} '->' v{{.NewRelease.Version}}",
        "exec_on_no_release": "echo {{.Reason}}: {{.Message}}"
      }
    }
  }
}

Success script configuration

The success script configuration accepts Go templates with the following variables:

A more detailed documentation about the available variables can be found here.

No release script configuration

The no release script configuration also accepts Go templates with the following variables:

A more detailed documentation about the available variables can be found here.

Licence

The MIT License (MIT)

Copyright © 2023 Christoph Witzko