Skip to content

feat: Add releasenote.command option to customize release notes with external scripts #298

@wreulicke

Description

@wreulicke

Summary

Add a new releasenote.command configuration option that executes a user-defined script with base_ref and head_ref as arguments, appending its output to the GitHub-generated release notes.

Currently, tagpr generates release notes using GitHub's auto-generated release notes feature. While this provides a good baseline (listing PRs, contributors, etc.), I often need to add custom content such as:

  • DB Schema Changes
  • Environment Variable Changes
  • Migration Changes

By providing a releasenote.command option, I can run my own scripts to generate additional content without modifying tagpr's core.

This enables using CHANGELOG.md as release checklists for application developers.

NOTE: releasenote.command is not proper naming.

Example

See https://gist.github.com/wreulicke/2209ea4a7f3d8a3f6fc17a6231ee7d23/a8e4e4e2ff263b1858d9722bc56e02378f302120

Proposed Solution

Configuration

# .tagpr
[tagpr]
releasenote.command = ./scripts/generate-important-changes.sh

Interface

<command> <base_ref> <head_ref>
# Example: ./scripts/generate-important-changes.sh v1.2.0 v1.3.0

Instead of this proposal, we can treats the command as go templates.

Behavior

Scenario Behavior
Config not set No external command executed
Command succeeds (exit 0) Append stdout to release notes to the last
Command fails (exit != 0) tagpr fails with error

This proposal just append to the last.
But, we have following 3 options;

  • pass generated release notes of tagpr into stdin; it enables customize overall.
  • append stdout of command to the last
  • append to the first

Example

#!/bin/bash
base_ref=$1
head_ref=$2

echo ""
echo "## Important Changes"
git log --oneline "${base_ref}..${head_ref}" | ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions