ci: Bump actions/checkout from 4 to 6 #2
Workflow file for this run
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: Dependabot Auto-Merge | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| dependabot: | |
| name: 🤖 Auto-merge Dependabot PRs | |
| runs-on: ubuntu-latest | |
| if: github.actor == 'dependabot[bot]' | |
| steps: | |
| - name: 📋 Fetch Dependabot metadata | |
| id: metadata | |
| uses: dependabot/fetch-metadata@v2 | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: 🔍 Check update type | |
| id: check-update | |
| run: | | |
| echo "Update type: ${{ steps.metadata.outputs.update-type }}" | |
| echo "Dependency names: ${{ steps.metadata.outputs.dependency-names }}" | |
| # Auto-approve security updates | |
| if [[ "${{ steps.metadata.outputs.update-type }}" == "version-update:semver-patch" ]] || \ | |
| [[ "${{ steps.metadata.outputs.update-type }}" == "version-update:semver-minor" ]] || \ | |
| [[ "${{ github.event.pull_request.labels[0].name }}" == "security" ]]; then | |
| echo "auto_merge=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "auto_merge=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: ✅ Auto-approve PR | |
| if: steps.check-update.outputs.auto_merge == 'true' | |
| run: gh pr review --approve "${{ github.event.pull_request.number }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 🚀 Enable auto-merge | |
| if: steps.check-update.outputs.auto_merge == 'true' | |
| run: gh pr merge --auto --squash "${{ github.event.pull_request.number }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 💬 Comment on PR | |
| if: steps.check-update.outputs.auto_merge == 'true' | |
| run: | | |
| gh pr comment "${{ github.event.pull_request.number }}" --body \ | |
| "🤖 **Auto-merge enabled** for this Dependabot PR. | |
| ✅ Update type: \`${{ steps.metadata.outputs.update-type }}\` | |
| 📦 Dependencies: ${{ steps.metadata.outputs.dependency-names }} | |
| This will merge automatically once CI checks pass." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: ⚠️ Manual review required | |
| if: steps.check-update.outputs.auto_merge == 'false' | |
| run: | | |
| gh pr comment "${{ github.event.pull_request.number }}" --body \ | |
| "⚠️ **Manual review required** for this major version update. | |
| 📦 Dependencies: ${{ steps.metadata.outputs.dependency-names }} | |
| 🔼 Update type: \`${{ steps.metadata.outputs.update-type }}\` | |
| Please review breaking changes before merging." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |