mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
CICD: gracefully handle non merge pushes
Also improve the spacing of the merge text a tiny bit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9bf79c460a
commit
7d918aeef1
1 changed files with 9 additions and 3 deletions
|
@ -7,14 +7,20 @@
|
|||
json=$(gh pr list -s merged -S "$1" --json title,number,url)
|
||||
|
||||
cp gh_release_notes_top gh_release_notes
|
||||
if [[ $json != "[]" ]]; then
|
||||
(
|
||||
echo -n 'This build was created by [merging PR'
|
||||
echo -n 'This build was created by [merging pull request '
|
||||
echo -n $json | jq -j '.[0]|{number}|join(" ")'
|
||||
echo -n '('
|
||||
echo -n ' ('
|
||||
echo -n $json | jq -j '.[0]|{title}|join(" ")'
|
||||
echo -n ')]('
|
||||
echo -n $json | jq -j '.[0]|{url}|join(" ")'
|
||||
echo ' )'
|
||||
) >> gh_release_notes
|
||||
|
||||
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
|
||||
cat gh_release_notes_bottom >> gh_release_notes
|
||||
|
|
Loading…
Reference in a new issue