|
42 | 42 | cd tools |
43 | 43 | python meetup_import.py |
44 | 44 |
|
| 45 | + - name: Confirm only events.yml was modified |
| 46 | + run: | |
| 47 | + MODIFIED_FILES=$(git diff --name-only) |
| 48 | + echo "Modified files: $MODIFIED_FILES" |
| 49 | + if echo "$MODIFIED_FILES" | grep -qv "^_data/events.yml$"; then |
| 50 | + echo "ERROR: Unexpected files were modified" |
| 51 | + exit 1 |
| 52 | + fi |
| 53 | + echo "Only events.yml was modified as expected" |
| 54 | +
|
45 | 55 | - name: Create or Update Pull Request |
| 56 | + id: create-pr |
46 | 57 | uses: peter-evans/create-pull-request@v7 |
47 | 58 | with: |
48 | 59 | token: ${{ secrets.GHA_ACTIONS_ALLOW_TOKEN }} |
|
56 | 67 |
|
57 | 68 | Please review the changes `_data/events.yml` and ensure that everything is parsed correctly before merging. |
58 | 69 | labels: | |
59 | | - automation |
60 | | - |
| 70 | + automation, auto-approve |
| 71 | +
|
| 72 | + - name: Wait for required checks |
| 73 | + if: steps.create-pr.outputs.pull-request-number |
| 74 | + run: | |
| 75 | + gh pr checks ${{ steps.create-pr.outputs.pull-request-number }} --watch |
| 76 | + env: |
| 77 | + GITHUB_TOKEN: ${{ secrets.GHA_ACTIONS_ALLOW_TOKEN }} |
| 78 | + |
| 79 | + - name: Auto-approve PR |
| 80 | + if: steps.create-pr.outputs.pull-request-number |
| 81 | + run: | |
| 82 | + echo "Approving PR #${{ steps.create-pr.outputs.pull-request-number }}" |
| 83 | + gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve |
| 84 | + echo "PR approved" |
| 85 | + env: |
| 86 | + GITHUB_TOKEN: ${{ secrets.GHA_APPROVAL_TOKEN }} |
| 87 | + |
| 88 | + - name: Auto-merge PR |
| 89 | + if: steps.create-pr.outputs.pull-request-number |
| 90 | + run: | |
| 91 | + echo "Auto-merge PR #${{ steps.create-pr.outputs.pull-request-number }}" |
| 92 | + gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} \ |
| 93 | + --auto \ |
| 94 | + --squash \ |
| 95 | + --delete-branch |
| 96 | + echo "Auto-merge completed" |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GHA_ACTIONS_ALLOW_TOKEN }} |
0 commit comments