hooks-exec

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 11 Imported by: 0

README

🦾 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-opts exec_on_success="echo v{{.NewRelease.Version}} " and --hooks-opts exec_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:

  • {{.PrevRelease.Version}}: The previous release version.
  • {{.NewRelease.Version}}: The new release version.
  • {{.Changelog}}: The release changelog.
  • {{.Commits}}: The commits between the previous and the new release.
  • {{.RepoInfo}}: The repository information.

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:

  • {{.Reason}}: The reason why no release was created. One of
  • {{.Message}}: The message why no release was created

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

Licence

The MIT License (MIT)

Copyright © 2023 Christoph Witzko

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL