Last active
February 4, 2024 02:08
-
-
Save snickell/80bea3908125d982704e36f51cd7dac3 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
gh pr list -L 57000 -s closed --json number,closedAt,mergedAt,updatedAt,url -q '.[] | select(.mergedAt == null and .updatedAt >= "2024-02-03T05:00:00Z" and .updatedAt <= "2024-02-03T06:00:00Z")' > misclosed.txt | |
# Add array braces and commas to make misclosed.txt a valid JSON list... | |
echo "[" > misclosed.json | |
awk 'NR > 1 { print line "," } { line = $0 } END { print line }' misclosed.txt >> misclosed.json | |
echo "]" >> misclosed.json | |
jq '.[].number' misclosed.json | while read number; do | |
echo "Reopening PR number: $number" | |
gh pr reopen "$number" --comment "This PR was accidentally auto-closed during the Git LFS migration (https://github.com/code-dot-org/code-dot-org/issues/55759), reopening it, sorry 'bout that 😘, -Seth" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment