[Sync Iteration] c/protein-translation/2 #25
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: Auto-merge Exercism sync PRs | |
| on: | |
| pull_request_target: | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| enable-automerge: | |
| if: > | |
| github.event.pull_request.user.login == 'exercism-solutions-syncer[bot]' && | |
| github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check changed files | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| files=$(gh pr diff "${{ github.event.pull_request.number }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --name-only) | |
| for file in $files; do | |
| if [[ "$file" != solutions/* ]]; then | |
| echo "File outside solutions/: $file" | |
| exit 1 | |
| fi | |
| done | |
| - name: Enable auto-merge | |
| if: success() | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr merge "${{ github.event.pull_request.number }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --rebase \ | |
| --auto |