2024-01-09 00:44:54 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# use to assemble the details for our release notes and write them to a file
|
|
|
|
#
|
2024-01-09 23:10:12 +00:00
|
|
|
# Usage: create-releasenotes.sh merge_sha
|
2024-01-09 00:44:54 +00:00
|
|
|
|
2024-01-09 23:10:12 +00:00
|
|
|
json=$(gh pr list -s merged -S "$1" --json title,number,url)
|
2024-01-09 00:44:54 +00:00
|
|
|
|
2024-01-09 23:10:12 +00:00
|
|
|
cp gh_release_notes_top gh_release_notes
|
2024-01-11 03:13:48 +00:00
|
|
|
if [[ $json != "[]" ]]; then
|
2024-01-09 23:10:12 +00:00
|
|
|
(
|
2024-01-11 03:13:48 +00:00
|
|
|
echo -n 'This build was created by [merging pull request '
|
2024-01-09 23:10:12 +00:00
|
|
|
echo -n $json | jq -j '.[0]|{number}|join(" ")'
|
2024-01-11 03:13:48 +00:00
|
|
|
echo -n ' ('
|
2024-01-09 23:10:12 +00:00
|
|
|
echo -n $json | jq -j '.[0]|{title}|join(" ")'
|
|
|
|
echo -n ')]('
|
|
|
|
echo -n $json | jq -j '.[0]|{url}|join(" ")'
|
|
|
|
echo ' )'
|
|
|
|
) >> gh_release_notes
|
2024-01-11 03:13:48 +00:00
|
|
|
else
|
|
|
|
(
|
|
|
|
echo "This build was created by directly pushing to the Subsurface repo."
|
|
|
|
echo "The latest commit was [$(git log --pretty=format:"%an: '%s'" -n1)](https://github.com/subsurface/subsurface/commit/$1 )"
|
|
|
|
) >> gh_release_notes
|
|
|
|
fi
|
2024-01-09 23:10:12 +00:00
|
|
|
cat gh_release_notes_bottom >> gh_release_notes
|