Skip to content

Commit

Permalink
chore: Add scripts/gen-release-notes.sh
Browse files Browse the repository at this point in the history
This script is used to generate release notes for a feature.

However, currently New Contributors is not displayed correctly, so it has been
added but not used.
  • Loading branch information
hankei6km committed Dec 24, 2023
1 parent e3f6d49 commit 057a34c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/gen-release-notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

# exmaple:
# scripts/gen-release-notes.hs [feature-name] x.y.z x.y.z-1

FEATURE="${1}"
TAG="feature_${FEATURE}_${2}"
PREV_TAG="feature_${FEATURE}_${3}"
test -n "${FEATURE}" || { echo "Missing feature name"; exit 1; }

# この方法は New Contributors の整合性がとれない.
# コミットはするが一旦保留。
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
'/repos/{owner}/{repo}/releases/generate-notes' \
-f tag_name="${TAG}"\
-f target_commitish='main' \
-f previous_tag_name="${PREV_TAG}" \
-f configuration_file_path=".github/release-${FEATURE}.yml" \
-q ".body" \
| sed '/^### Exclude from changelog/,/^### /{//!d}' | grep -v -e "^### Exclude from changelog"

0 comments on commit 057a34c

Please sign in to comment.