Skip to content

Commit

Permalink
Merge pull request #5 from grails/puneetbehl-patch-1
Browse files Browse the repository at this point in the history
Allow passing RELEASE_URL to post-release action
  • Loading branch information
puneetbehl authored Jul 22, 2023
2 parents 9f92e05 + 8cd9d37 commit 2ed8f75
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions post-release/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,20 @@ echo "Getting issues closed"
issues_closed=`curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY/issues?milestone=$milestone_number&state=closed" | jq '.[] | "* \(.title) (#\(.number))"' | sed -e 's/^"\(.*\)"$/\1/g'`
echo $issues_closed

echo -n "Getting release url: "
release_url=`cat $GITHUB_EVENT_PATH | jq '.release.url' | sed -e 's/^"\(.*\)"$/\1/g'`
if [ -z "$RELEASE_URL" ]; then
echo -n "Getting release url: "
release_url=`cat $GITHUB_EVENT_PATH | jq '.release.url' | sed -e 's/^"\(.*\)"$/\1/g'`
else
release_url=$RELEASE_URL
fi
echo $release_url

echo -n "Getting release body: "
release_body=`cat $GITHUB_EVENT_PATH | jq '.release.body' | sed -e 's/^"\(.*\)"$/\1/g'`
if [ -z "$RELEASE_URL" ]; then
release_body=$(curl -i --request PATCH -H "Authorization: Bearer $1" -H "Content-Type: application/json" $release_url | jq '.release.body' | sed -e 's/^"\(.*\)"$/\1/g'`)
else
release_body=`cat $GITHUB_EVENT_PATH | jq '.release.body' | sed -e 's/^"\(.*\)"$/\1/g'`
fi
echo $release_body
echo -n "Updating release body: "
Expand Down

0 comments on commit 2ed8f75

Please sign in to comment.