Forked from jemc/gh-enable-all-inactivity-disabled-workflows.fish
Last active
February 11, 2025 14:04
-
-
Save svetlyak40wt/cda203d96419d1efe764e889fa58475d to your computer and use it in GitHub Desktop.
Use GitHub CLI to enable all workflows that were disabled due to repository inactivity - either for all repos in a given org that you manage, or (by default) your personal repos.
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
function gh-enable-all-inactivity-disabled-workflows-for-org () { | |
org=$1 | |
gh repo list --no-archived --limit 1000 $org | cut -f 1 | xargs -I REPO sh -c 'gh workflow list --all -R REPO | grep disabled_inactivity | cut -f 3 | xargs -I WORKFLOW sh -xc "gh workflow enable WORKFLOW -R REPO"' | |
} | |
function gh-enable-all-inactivity-disabled-workflows () { | |
# for user | |
gh-enable-all-inactivity-disabled-workflows-for-org | |
# for his organizations | |
for org in $(gh org list --limit 1000); do | |
gh-enable-all-inactivity-disabled-workflows-for-org $org | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment