Created
August 14, 2024 20:32
-
-
Save bashbunni/30d3596046bf954ba9a266a8d3371e7d to your computer and use it in GitHub Desktop.
Use GitHub CLI to check for overdue releases
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
#!/usr/bin/env sh | |
# Run this script in the directory that contains repos whose release dates you | |
# want to check. | |
for dir in */; do | |
# check if it's a git repo | |
cd $PWD/$dir | |
if [ -d ".git" ]; then | |
latest=$(gh release ls | grep "Latest") | |
# check if it has a latest release | |
if [[ $latest ]]; then | |
needs_release=$(date -v-2m '+%Y-%m-%d') | |
# check if it was more than a couple of months ago | |
release_date=$(echo $latest | grep -Eo "[0-9]{4}\-[0-9]{2}\-[0-9]{2}") | |
if [[ "${needs_release}" > "${release_date}" ]]; then | |
echo $dir | |
echo $latest | |
fi | |
fi | |
fi | |
cd ../ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment