Skip to content

Commit

Permalink
Update repo-activity-check.yml
Browse files Browse the repository at this point in the history
Calculate date two years ago

Signed-off-by: James Taylor <[email protected]>
  • Loading branch information
jt-nti committed Nov 28, 2024
1 parent cdcdba1 commit 0734bdc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/repo-activity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "\nPublic repositories:"
since=$(date -d "2 years ago" "+%Y-%m-%d")
echo "Public repositories:"
gh search repos --owner=cicsdev --visibility=public --archived=false --limit=99 --json=name --jq=.[].name | sort | tee public-repos.txt
echo "\nActive repositories:"
gh search repos --owner=cicsdev --visibility=public --archived=false --limit=99 --updated=">2022-11-28" --json=name --jq=.[].name | sort | tee active-repos.txt
echo "\nStale repositories:"
echo "Active repositories since $since:"
gh search repos --owner=cicsdev --visibility=public --archived=false --limit=99 --updated=">$since" --json=name --jq=.[].name | sort | tee active-repos.txt
echo "Stale repositories:"
comm -13 active-repos.txt public-repos.txt | tee stale-repos.txt
count=$(wc -l < stale-repos.txt)
[ $count -eq 0 ] || { echo "::error title=Stale repositories::There are $count stale repositories"; exit 1; }

0 comments on commit 0734bdc

Please sign in to comment.