提交 628fee2b 编写于 作者: T Thomas Stromberg

Rename release notes script, add error detection.

上级 dd96eed9
......@@ -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.
......
......@@ -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 )
......
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册