Sync Dependabot Config #24
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
| name: Sync Dependabot Config | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| sync-dependabot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup-github-app-git | |
| with: | |
| private-key: ${{ secrets.PM_CICD_APP_PRIVATE_KEY }} | |
| - name: Sync Dependabot Config | |
| env: | |
| ORG_NAME: ProcessMaker | |
| run: | | |
| set -euo pipefail | |
| while IFS= read -r repo || [ -n "$repo" ]; do | |
| [ -z "$repo" ] && continue | |
| [[ "$repo" =~ ^# ]] && continue | |
| echo "Processing $ORG_NAME/$repo" | |
| rm -rf "$repo" | |
| git clone --depth 1 "https://github.com/$ORG_NAME/$repo.git" "$repo" | |
| mkdir -p "$repo/.github" | |
| cp .github/templates/dependabot.yml "$repo/.github/dependabot.yml" | |
| cd "$repo" | |
| if git diff --quiet; then | |
| echo "No changes for $repo" | |
| else | |
| git add .github/dependabot.yml | |
| git commit -m "chore: sync dependabot config" | |
| git push | |
| fi | |
| cd .. | |
| rm -rf "$repo" | |
| done < repos-dependabot.txt |