Skip to content

Instantly share code, notes, and snippets.

@fzipi
Last active October 2, 2022 11:54
Show Gist options
  • Save fzipi/212a31996a955238b070f3cbdcf828cb to your computer and use it in GitHub Desktop.
Save fzipi/212a31996a955238b070f3cbdcf828cb to your computer and use it in GitHub Desktop.
Generates the CRS agenda for the monthly meeting.
#!/usr/bin/env bash
export GH_PAGER=cat
if [ ! $(which gh) ]; then
echo "We need the gh command for this."
exit 1
fi
lastmeeting=$1
if [ $(gdate -d "$lastmeeting" 2>&1 >/dev/null) ]; then
echo "Please input the last meeting date, using format YYYY-MM-DD"
exit 1
fi
echo '### PRs that have been merged since the last meeting'
echo
gh pr list --repo coreruleset/coreruleset --search "is:pr is:merged sort:updated-desc closed:>=$lastmeeting" --json number --template '{{range .}}{{printf "* #%v\n" .number}}{{end}} {{- printf "\nWe merged %d PRs since the last monthly project chat.\n" (len .) }}'
echo
echo '## Open PRs'
echo
echo '### Open PRs marked *DRAFT* or *work in progress* or *needs action*'
echo
gh pr list --repo coreruleset/coreruleset --search "is:pr is:open draft:false -label:\"needs action\",\"work in progress\" sort:updated-desc" --json number --template '{{range .}}{{printf "* #%v\n" .number}}{{end}}'
gh pr list --repo coreruleset/coreruleset --search "is:pr is:open label:\"needs action\",\"work in progress\" sort:interactions-desc" --json number --template '{{range .}}{{printf "* #%v\n" .number}}{{end}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment