Skip to content

go-semantic-release/hooks-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2160e6d Â· Oct 13, 2024

History

7 Commits
Oct 13, 2024
Feb 9, 2023
Feb 9, 2023
Feb 9, 2023
Feb 9, 2023
Feb 9, 2023
Feb 9, 2023
Feb 9, 2023
Feb 20, 2024
Oct 13, 2024
Oct 13, 2024
Feb 9, 2023
Feb 9, 2023

Repository files navigation

🦾 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:

  • {{.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