Created
January 3, 2023 01:52
-
-
Save zacharysyoung/7b573dc0bc250b26e933894ec9f52be1 to your computer and use it in GitHub Desktop.
Get forks JQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $ageThresholdInSeconds passed in from command-line, like `jq --arg ageThresholdInSeconds 10 -f <this-file>` | |
def selectOnlyModifiedForks: | |
((.updated_at | fromdate) - (.created_at | fromdate)) as $ageDiffInSeconds | |
| select( | |
$ageDiffInSeconds > ($ageThresholdInSeconds | tonumber) | |
) | |
; | |
[ | |
.[] | |
| selectOnlyModifiedForks | |
| { | |
html_url: .html_url, | |
created_at: .created_at, | |
updated_at: .updated_at | |
} | |
] | |
| sort_by(.updated_at) | |
| reverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment