forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gh-cli-for-release-notes.sh
executable file
·61 lines (47 loc) · 2.91 KB
/
gh-cli-for-release-notes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
#
# Helper script to prepare changelog for a release.
#
# It filters GitHub issues and pull requests for the specified milestone and
# prints a list on standard output. The generated list needs to be reviewed by
# a maintainer before including it to the CHANGELOG.
#
# It uses GitHub CLI from https://github.com/cli/cli
#
# Usage: gh-cli-release-notes.sh <GitHub milestone name>
#
if [[ $# -eq 0 ]] ; then
echo 'Usage: gh-cli-release-notes.sh <GitHub milestone name>'
exit 1
fi
MILESTONE=$1
echo
echo "${MILESTONE} ($(date "+%Y-%m-%d"))"
echo ===========================
echo
echo "Summary of Changes:"
echo
echo "Breaking Changes:"
echo
gh issue list -S 'milestone:"'"${MILESTONE}"'" label:breaking' -s all -L 500 --json number,title --jq '.[] | "- GH #\(.number) \(.title)"'
gh pr list -S 'milestone:"'"${MILESTONE}"'" label:breaking' -s all -L 500 --json number,title --jq '.[] | "- PR #\(.number) \(.title)"'
echo
echo "Security Fixes:"
echo
gh issue list -S 'milestone:"'"${MILESTONE}"'" -label:breaking label:security' -s all -L 500 --json number,title --jq '.[] | "- GH #\(.number) \(.title)"'
gh pr list -S 'milestone:"'"${MILESTONE}"'" -label:breaking label:security' -s all -L 500 --json number,title --jq '.[] | "- PR #\(.number) \(.title)"'
echo
echo "Features, Enhancements and Third Party Updates:"
echo
gh issue list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:security label:enhancement' -s all -L 500 --json number,title --jq '.[] | "- GH #\(.number) \(.title)"'
gh issue list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:security -label:enhancement label:feature' -s all -L 500 --json number,title --jq '.[] | "- GH #\(.number) \(.title)"'
gh issue list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:security -label:enhancement -label:feature label:third-party' -s all -L 500 --json number,title --jq '.[] | "- GH #\(.number) \(.title)"'
gh pr list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:security label:enhancement' -s all -L 500 --json number,title --jq '.[] | "- PR #\(.number) \(.title)"'
gh pr list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:security -label:enhancement label:feature' -s all -L 500 --json number,title --jq '.[] | "- PR #\(.number) \(.title)"'
gh pr list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:security -label:enhancement -label:feature label:third-party' -s all -L 500 --json number,title --jq '.[] | "- PR #\(.number) \(.title)"'
echo
echo "Bug Fixes and Improvements:"
echo
gh issue list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:enhancement -label:feature -label:security -label:third-party' -s all -L 500 --json number,title --jq '.[] | "- GH #\(.number) \(.title)"'
gh pr list -S 'milestone:"'"${MILESTONE}"'" -label:breaking -label:enhancement -label:feature -label:security -label:third-party' -s all -L 500 --json number,title --jq '.[] | "- PR #\(.number) \(.title)"'
echo