Skip to content

Instantly share code, notes, and snippets.

@enerick
Last active September 14, 2021 10:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enerick/d171eb7c71e6cad97a091ca940915391 to your computer and use it in GitHub Desktop.
Save enerick/d171eb7c71e6cad97a091ca940915391 to your computer and use it in GitHub Desktop.
Create md file that lists PR/Issues I created within the period (requires `gh` command)
for i in 1 2 3 4 5
do
gh api -X GET search/issues \
-f q='archived:false created:2021-04-01..2021-09-30 author:@me sort:created-asc' \
-f per_page=100 \
-f page=$i \
-q '.items | map(. += { "repo": (.html_url | split("/") | .[-4] + "/" + .[-3] + "#" + .[-1]), "date": (.created_at | split("T") | .[0]) }) | map("1. " + .date + " [" + .title + "](" + .html_url + ") (" + .repo + ")") | .[]' \
>> pr.md
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment