cargo-binstall/ci-scripts/extract-release-notes.sh
2022-07-24 20:33:56 +12:00

16 lines
380 B
Bash
Executable file

#!/bin/bash
set -euxo pipefail
release_pr=$(head -n1 <<< "${COMMIT_MESSAGE:-}" | jq -Rr 'split("[()]"; "")[1] // ""')
if [[ -z "$release_pr" ]]; then
echo "::set-output name=notes_json::null"
exit
fi
gh \
pr --repo "$GITHUB_REPO" \
view "$release_pr" \
--json body \
--jq '"::set-output name=notes_json::\((.body | split("### Release notes")[1] // "") | tojson)"'