Created
August 10, 2025 09:24
-
-
Save Vitexus/436fdc710bb5c9c1035e5b6d4a4c947c to your computer and use it in GitHub Desktop.
Enable Dependabot everywhere
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
| ORG="VitexSoftware" | |
| CONFIG_FILE=".github/dependabot.yml" | |
| mkdir -p .github | |
| cat > "$CONFIG_FILE" <<'EOF' | |
| version: 2 | |
| updates: | |
| - package-ecosystem: "composer" | |
| directory: "/" | |
| schedule: | |
| interval: "weekly" | |
| open-pull-requests-limit: 10 | |
| versioning-strategy: increase | |
| commit-message: | |
| prefix: "composer" | |
| - package-ecosystem: "github-actions" | |
| directory: "/" | |
| schedule: | |
| interval: "weekly" | |
| EOF | |
| # For each PHP repository | |
| gh repo list "$ORG" --limit 200 --json name,primaryLanguage -q '.[] | select(.primaryLanguage.name=="PHP") | .name' | while read REPO; do | |
| echo "Processing $REPO..." | |
| gh repo clone "$ORG/$REPO" tmp-repo | |
| cd tmp-repo | |
| mkdir -p .github | |
| cp ../$CONFIG_FILE .github/dependabot.yml | |
| git checkout -b enable-dependabot | |
| git add .github/dependabot.yml | |
| git commit -m "Enable Dependabot for PHP and GitHub Actions" | |
| git push origin enable-dependabot | |
| gh pr create --title "Enable Dependabot" --body "This PR enables Dependabot for Composer and GitHub Actions." --base main | |
| cd .. | |
| rm -rf tmp-repo | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment