2023-04-27 13:03:45 -04:00
#!/bin/bash
# this script is used to generate release notes for a given release
# first argument is the pull request id for the last release
# the second is the new release number
# the script then grabs every pull request merged since that pull request
# and outputs a string of release notes
2023-05-02 14:54:11 -04:00
# get the new release number
NEW_RELEASE = $2
echo " Generating release notes for $NEW_RELEASE "
2023-04-27 13:03:45 -04:00
# get the last release pull request id
LAST_RELEASE_PR = $1
2023-05-02 14:54:11 -04:00
2023-04-27 13:03:45 -04:00
#get when the last release was merged
2023-05-05 13:38:29 -04:00
LAST_RELEASE_MERGED_AT = $( gh pr view $LAST_RELEASE_PR --repo actions/languageservices --json mergedAt | jq -r '.mergedAt' )
2023-04-27 13:03:45 -04:00
2023-05-05 13:38:29 -04:00
CHANGELIST = $( gh pr list --repo actions/languageservices --base main --state merged --json title --search " merged:> $LAST_RELEASE_MERGED_AT -label:no-release " )
2023-04-27 13:03:45 -04:00
# store the release notes in a variable so we can use it later
2023-05-02 13:05:17 -04:00
echo " Release $NEW_RELEASE " >> releasenotes.md
2023-04-27 13:03:45 -04:00
2023-05-02 13:05:17 -04:00
echo $CHANGELIST | jq -r '.[].title' | while read line; do
echo " - $line " >> releasenotes.md
done
2023-04-27 13:03:45 -04:00
2023-05-02 14:54:11 -04:00
echo " "