Rename release notes script, add error detection.

pull/3215/head
Thomas Stromberg 2018-10-04 14:31:57 -07:00
parent dd96eed9d4
commit 628fee2b44
3 changed files with 11 additions and 4 deletions

View File

@ -2,10 +2,10 @@
## Create a Release Notes PR
Collect meaningful changes:
Collect the release notes, and edit them as necessary:
```shell
hack/release.sh
hack/release_notes.sh
```
Then merge into the CHANGELOG.md file. See [this PR](https://github.com/kubernetes/minikube/pull/164) for an example.

View File

@ -12,6 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux -o pipefail
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

View File

@ -57,13 +57,16 @@ func main() {
func printPullRequests() {
client := getClient()
releases, _, _ := client.Repositories.ListReleases(context.Background(), org, repo, &github.ListOptions{})
releases, _, err := client.Repositories.ListReleases(context.Background(), org, repo, &github.ListOptions{})
if err != nil {
logrus.Fatal(err)
}
lastReleaseTime := *releases[0].PublishedAt
fmt.Println(fmt.Sprintf("Collecting pull request that were merged since the last release: %s (%s)", *releases[0].TagName, lastReleaseTime))
listSize := 1
for page := 1; listSize > 0; page++ {
pullRequests, _, _ := client.PullRequests.List(context.Background(), org, repo, &github.PullRequestListOptions{
pullRequests, _, err := client.PullRequests.List(context.Background(), org, repo, &github.PullRequestListOptions{
State: "closed",
Sort: "updated",
Direction: "desc",
@ -72,6 +75,9 @@ func printPullRequests() {
Page: page,
},
})
if err != nil {
logrus.Fatal(err)
}
seen := 0
for idx := range pullRequests {