a script to fetch a list of repos and sort them by last activity.
This commit is contained in:
parent
cdb4d4daa2
commit
acfd0026ca
50
check_active_repos.sh
Normal file
50
check_active_repos.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# List of GitHub repositories
|
||||
repos=(
|
||||
"atas/ssg"
|
||||
"cfenollosa/bashblog"
|
||||
"venthur/blag"
|
||||
"spekulatius/laravel-commonmark-blog"
|
||||
"imfunniee/gitfolio"
|
||||
"dannyvankooten/gozer"
|
||||
"hexojs/hexo"
|
||||
"hyde/hyde"
|
||||
"styxlab/next-cms-ghost"
|
||||
"jekyll/jekyll"
|
||||
"kabukky/journey"
|
||||
"sunainapai/makesite"
|
||||
"imathis/octopress"
|
||||
"getpelican/pelican"
|
||||
"williamd1k0/sake"
|
||||
"spress/Spress"
|
||||
"nakkaya/static"
|
||||
"vladris/tinkerer"
|
||||
"leonstafford"
|
||||
)
|
||||
|
||||
# Function to get the last commit date
|
||||
get_last_commit_date() {
|
||||
curl -s "https://api.github.com/repos/$1/commits" | jq -r '.[0].commit.author.date // empty'
|
||||
}
|
||||
|
||||
# Check and collect activity data
|
||||
activity_data=()
|
||||
for repo in "${repos[@]}"; do
|
||||
last_commit_date=$(get_last_commit_date "$repo")
|
||||
if [[ ! -z "$last_commit_date" ]]; then
|
||||
activity_data+=("$repo: $last_commit_date")
|
||||
else
|
||||
activity_data+=("$repo: No recent activity or inaccessible")
|
||||
fi
|
||||
done
|
||||
|
||||
# Sort and print the activity data
|
||||
IFS=$'\n' sorted_activity_data=($(sort -t: -k2 <<<"${activity_data[*]}"))
|
||||
unset IFS
|
||||
|
||||
echo "Repository activity (sorted by date):"
|
||||
for data in "${sorted_activity_data[@]}"; do
|
||||
echo "$data"
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user