name: 'Maintenance'
on:
  # So that PRs touching the same files as the push are updated
  push:
    branches:
      - master
      - next
  # So that the `dirtyLabel` is removed if conflicts are resolved
  # Could put too much strain on rate limit
  # If we hit the rate limit too often remove this event
  pull_request_target:
    branches:
      - master
      - next
    types: [synchronize]

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: check if prs are dirty
        uses: eps1lon/actions-label-merge-conflict@releases/1.x
        with:
          dirtyLabel: 'PR: out-of-date'
          removeOnDirtyLabel: 'PR: ready to ship'
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          retryAfter: 130
          retryMax: 10
