From 3b8ebe9c6ad3021323c80831878c138b0e1c8aff Mon Sep 17 00:00:00 2001 From: Caedis Date: Mon, 27 Oct 2025 13:39:30 -0500 Subject: [PATCH] Add way to override changelog used for release (#53) --- .github/workflows/release-tags.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 847a6f7..1994341 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -76,12 +76,20 @@ jobs: if [[ "$SNAPSHOT" == "true" ]]; then PRERELEASE="--prerelease" fi - export "CHANGELOG_FILE=$(mktemp --suffix=.md)" - echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV - gh api --method POST -H "Accept: application/vnd.github+json" \ - "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \ - -f tag_name="${RELEASE_VERSION}" \ - --jq ".body" > "${CHANGELOG_FILE}" + CHANGELOG_OVERRIDE=".changelogs/${RELEASE_VERSION}.md" + if [[ -f "$CHANGELOG_OVERRIDE" ]]; then + echo "Using changelog override: $CHANGELOG_OVERRIDE" + export "CHANGELOG_FILE=$CHANGELOG_OVERRIDE" + echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV + else + echo "Generating changelog notes..." + export "CHANGELOG_FILE=$(mktemp --suffix=.md)" + echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV + gh api --method POST -H "Accept: application/vnd.github+json" \ + "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \ + -f tag_name="${RELEASE_VERSION}" \ + --jq ".body" > "${CHANGELOG_FILE}" + fi cat "${CHANGELOG_FILE}" gh release create "${RELEASE_VERSION}" -F "${CHANGELOG_FILE}" $PRERELEASE ./build/libs/*.jar shell: bash