Created
August 5, 2025 08:35
-
-
Save woolinsilver/cabd0aec99553241c84e2cceba560522 to your computer and use it in GitHub Desktop.
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 bash | |
| set -euo pipefail | |
| if [ $# -ne 1 ]; then | |
| echo "Usage: $(basename "$0") ORG/REPO" | |
| exit 1 | |
| fi | |
| REPO="$1" | |
| echo | |
| echo "🔧 Updating settings..." | |
| echo | |
| echo " - Disabling wiki" | |
| echo " - Disabling issues" | |
| echo " - Disabling projects" | |
| echo " - Enabling merge commits (defaulting to PR title)" | |
| echo " - Enabling squash merge (defaulting to PR title)" | |
| echo " - Enabling rebase merge" | |
| echo " - Disabling automatic branch updates" | |
| echo " - Enabling auto-delete of head branches after merge" | |
| echo | |
| gh api --silent --method PATCH "/repos/$REPO" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -F has_wiki=false \ | |
| -F has_issues=false \ | |
| -F has_projects=false \ | |
| -F allow_merge_commit=true \ | |
| -F merge_commit_title=PR_TITLE \ | |
| -F merge_commit_message=BLANK \ | |
| -F allow_squash_merge=true \ | |
| -F squash_merge_commit_title=PR_TITLE \ | |
| -F squash_merge_commit_message=BLANK \ | |
| -F allow_rebase_merge=true \ | |
| -F allow_update_branch=false \ | |
| -F delete_branch_on_merge=true | |
| echo "✅ Success" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment