| 1 | # Detect and label pull requests that have merge conflicts | 1 | # Detect and label pull requests that have merge conflicts |
| | 2 | |
| | 3 | # Label Conflicting Pull Requests |
| | 4 | # https://github.com/marketplace/actions/label-conflicting-pull-requests |
| | 5 | |
| 2 | name: 🏗️ Check Merge Conflicts | 6 | name: 🏗️ Check Merge Conflicts |
| 3 | on: | 7 | on: |
| | 8 | # So that PRs touching the same files as the push are updated |
| 4 | push: | 9 | push: |
| 5 | branches: | 10 | # So that the `dirtyLabel` is removed if conflicts are resolve |
| 6 | - staging | 11 | # We recommend `pull_request_target` so that github secrets are available. |
| | 12 | # In `pull_request` we wouldn't be able to change labels of fork PRs |
| | 13 | pull_request_target: |
| | 14 | types: [synchronize] |
| | 15 | |
| 7 | jobs: | 16 | jobs: |
| 8 | check-conflicts: | 17 | check-conflicts: |
| 9 | if: github.repository == 'SillyTavern/SillyTavern' | | |
| 10 | runs-on: ubuntu-latest | 18 | runs-on: ubuntu-latest |
| 11 | steps: | 19 | steps: |
| 12 | - uses: mschilde/auto-label-merge-conflicts@master | 20 | - name: Check Merge Conflicts |
| | 21 | uses: eps1lon/actions-label-merge-conflict@v3 |
| 13 | with: | 22 | with: |
| 14 | CONFLICT_LABEL_NAME: "🚫 Merge Conflicts" | | |
| 15 | GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | | |
| 16 | MAX_RETRIES: 5 | | |
| 17 | WAIT_MS: 5000 | | |
| 17 |
\ No newline at end of file | |
\ No newline at end of file |
| | 23 | dirtyLabel: "🚫 Merge Conflicts" |
| | 24 | repoToken: "${{ secrets.GITHUB_TOKEN }}" |
| | 25 | commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged." |