Skip to content

Commit 2063a86

Browse files
committed
Switch to GitHub API for release notes generation
Replaces the mikepenz/release-changelog-builder-action with the GitHub API via actions/github-script to generate release notes. Adds a step to fetch the previous tag for more accurate changelog generation.
1 parent defe3b9 commit 2063a86

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/workflows/publish_release.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,36 @@ jobs:
4848
echo "tag_exists=false" >> $GITHUB_ENV
4949
fi
5050
51+
# Get Previous Tag
52+
- name: Get Previous Tag
53+
id: previous_tag
54+
if: env.tag_exists == 'false'
55+
run: |
56+
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
57+
echo "previous_tag=$PREV_TAG" >> $GITHUB_OUTPUT
58+
echo "Previous tag: $PREV_TAG"
59+
5160
# Generate Release Notes
5261
- name: Generate Release Notes
5362
id: changelog
5463
if: env.tag_exists == 'false'
55-
uses: mikepenz/release-changelog-builder-action@v5.0.0
64+
uses: actions/github-script@v7
65+
with:
66+
script: |
67+
const params = {
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
tag_name: '${{ steps.get_version.outputs.version }}',
71+
target_commitish: context.sha
72+
};
73+
74+
const previousTag = '${{ steps.previous_tag.outputs.previous_tag }}';
75+
if (previousTag) {
76+
params.previous_tag_name = previousTag;
77+
}
78+
79+
const { data } = await github.rest.repos.generateReleaseNotes(params);
80+
core.setOutput('changelog', data.body);
5681
env:
5782
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5883

@@ -75,10 +100,6 @@ jobs:
75100
if: env.tag_exists == 'false'
76101
run: |
77102
mkdir -p src/releases
78-
zip -r src/releases/release_${{ steps.get_version.outputs.version }}.zip . \
79-
--exclude "./src/releases/*" \
80-
--exclude ".*" \
81-
--exclude ".*/**"
82103
zip -r src/releases/latest.zip . \
83104
--exclude "./src/releases/*" \
84105
--exclude ".*" \

0 commit comments

Comments
 (0)