diff --git a/ci/check-in.sh b/ci/check-in.sh new file mode 100755 index 00000000..d41a7ae5 --- /dev/null +++ b/ci/check-in.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +set -eu + +# This is not a very smart script +if [ $# != 2 ]; then + echo "usage: $0 " + if [ $# = 1 ] ; then + echo "help: you can find the number of PRs merged at" \ + "https://github.com/rust-lang/rustc-dev-guide/pulls?q=is%3Apr+is%3Aclosed+updated%3A%3E$1" + fi + exit 1 +fi + +curl() { + command curl -s "$@" +} + +# Get recently updated PRs +curl "https://api.github.com/repos/rust-lang/rustc-dev-guide/pulls?state=closed&per_page=$2" \ + | jq '[.[] | select(.merged_at > "'"$1"'")]' > pulls.json + +show_pulls() { + jq -r '.[] | { title, number, html_url, user: .user.login } | "- " + .title + " [#" + (.number | tostring) + "](" + .html_url + ")"' +} + +echo "Authors:" +jq -r '{ login: .[].user.login } | "- **@" + .login + "**"' < pulls.json | sort -u +echo "Changes:" +show_pulls < pulls.json +echo "Changes in progress:" +# If there are more than 30 PRs open at a time, you'll need to set `per_page`. +# For now this seems unlikely. +curl "https://api.github.com/repos/rust-lang/rustc-dev-guide/pulls?state=open" | show_pulls