Skip to content

Instantly share code, notes, and snippets.

@D3SOX
Created November 11, 2025 22:13
Show Gist options
  • Select an option

  • Save D3SOX/7efe4b886f271e474a11655af765cf38 to your computer and use it in GitHub Desktop.

Select an option

Save D3SOX/7efe4b886f271e474a11655af765cf38 to your computer and use it in GitHub Desktop.
Since GitHub decided to remove that feature I created a script that watches all your repos https://github.blog/changelog/2025-05-22-sunset-of-automatic-watching-of-repositories-and-teams/
#!/usr/bin/env bash
set -euo pipefail
# Extract the logged-in GitHub username
USER=$(gh auth status 2>/dev/null | grep -oE 'account [^ ]+' | awk '{print $2}')
if [ -z "${USER:-}" ]; then
echo "❌ Could not detect logged-in GitHub username. Run 'gh auth login' first."
exit 1
fi
echo "πŸ‘€ Logged in as $USER"
echo "πŸ” Checking repositories..."
# Loop through your repos and subscribe to all activity if not already watching
gh repo list "$USER" --limit 1000 --json name,owner | jq -r '.[] | "\(.owner.login)/\(.name)"' | while read -r repo; do
echo "Checking $repo..."
sub=$(gh api "repos/$repo/subscription" --jq '.subscribed' 2>/dev/null || echo "false")
if [ "$sub" != "true" ]; then
echo "➑ Subscribing to $repo"
gh api --method PUT "repos/$repo/subscription" \
--input <(echo '{"subscribed": true, "ignored": false}') \
>/dev/null || echo "❌ Failed to subscribe to $repo"
else
echo "βœ… Already watching $repo"
fi
done
echo "🎯 Done! All your repositories are now set to 'Watching (All Activity)'."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment