Skip to content

Commit 708fdfd

Browse files
authored
Merge pull request #150 from github/auto-generate-notes
automatically generate release notes
2 parents 0ff1a03 + c981b64 commit 708fdfd

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ jobs:
6767

6868
- name: Create PR
6969
run: |
70+
LAST_PR=$(gh pr list --repo ${{ github.repository }} --limit 1 --state merged --search "Release version" --json number | jq -r '.[0].number')
71+
./script/workflows/generate-release-notes.sh $LAST_PR ${{ env.new_version }}
7072
gh pr create \
7173
--title "Release version ${{ env.new_version }}" \
72-
--body "Release version ${{ env.new_version }}" \
74+
--body-file releasenotes.md \
7375
--base main \
7476
--head release/${{ env.new_version }}
7577
env:

release-notes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Release 0.25.7
2+
- Add working lock file and update script to add it to the npm workspace root \n
3+
- Make pre-prepare run off of hooks \n
4+
- @muzimuzhi - Upgrade vsce 2.11.0 to @vscode/vsce version 2.19.0 \n
5+
- Update workflow file \n
6+
- Release version 0.25.6 \n
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# this script is used to generate release notes for a given release
3+
# first argument is the pull request id for the last release
4+
# the second is the new release number
5+
6+
# the script then grabs every pull request merged since that pull request
7+
# and outputs a string of release notes
8+
9+
echo "Generating release notes for $2"
10+
11+
# get the last release pull request id
12+
LAST_RELEASE_PR=$1
13+
14+
# get the new release number
15+
NEW_RELEASE=$2
16+
17+
#get when the last release was merged
18+
LAST_RELEASE_MERGED_AT=$(gh pr view $LAST_RELEASE_PR --repo github/vscode-github-actions --json mergedAt | jq -r '.mergedAt')
19+
20+
CHANGELIST=$(gh pr list --repo github/vscode-github-actions --base main --state merged --json title --search "merged:>$LAST_RELEASE_MERGED_AT -label:no-release")
21+
22+
# store the release notes in a variable so we can use it later
23+
24+
echo "Release $NEW_RELEASE" >> releasenotes.md
25+
26+
echo $CHANGELIST | jq -r '.[].title' | while read line; do
27+
echo " - $line" >> releasenotes.md
28+
done
29+
30+
echo " "

0 commit comments

Comments
 (0)