queue_rules:
  - name: default
    conditions:
      - status-success=pr-complete
pull_request_rules:
  - name: Resolve conflict
    conditions:
      - conflict
    actions:
        comment:
          message: This pull request has conflicts when rebasing. Could you fix it @{{author}}? 🙏
  - name: MickeyMoz - Auto Merge
    conditions:
      - author=MickeyMoz
      - status-success=pr-complete
      - files~=(Gecko.kt|AndroidComponents.kt)
    actions:
      review:
        type: APPROVE
        message: MickeyMoz 💪
      queue:
        method: rebase
        name: default
        rebase_fallback: none
  - name: L10N - Auto Merge
    conditions:
      - author=mozilla-l10n-automation-bot
      - status-success=pr-complete
      - files~=(strings.xml|l10n.toml)
    actions:
      review:
        type: APPROVE
        message: LGTM 😎
      queue:
        method: rebase
        name: default
        rebase_fallback: none
  - name: Release automation (Old)
    conditions:
      - base~=releases[_/].*
      - author=github-actions[bot]
      # Listing checks manually beause we do not have a "push complete" check yet.
      - check-success=build-android-test-debug
      - check-success=build-debug
      - check-success=build-nightly-simulation
      - check-success=lint-compare-locales
      - check-success=lint-detekt
      - check-success=lint-ktlint
      - check-success=lint-lint
      - check-success=signing-android-test-debug
      - check-success=signing-debug
      - check-success=signing-nightly-simulation
      - check-success=test-debug
      - check-success=ui-test-x86-debug
      - files~=(AndroidComponents.kt)
    actions:
      review:
        type: APPROVE
        message: 🚢
      queue:
        method: rebase
        name: default
        rebase_fallback: none
      delete_head_branch:
        force: false
  - name: Release automation (New)
    conditions:
      - base~=releases[_/].*
      - author=github-actions[bot]
      # Listing checks manually beause we do not have a "push complete" check yet.
      - check-success=build-android-test-beta
      - check-success=build-android-test-debug
      - check-success=build-beta-firebase
      - check-success=build-debug
      - check-success=build-nightly-simulation
      - check-success=lint-compare-locales
      - check-success=lint-detekt
      - check-success=lint-ktlint
      - check-success=lint-lint
      - check-success=signing-android-test-beta
      - check-success=signing-beta-firebase
      - check-success=signing-nightly-simulation
      - check-success=test-debug
      - check-success=ui-test-x86-beta
      - files~=(AndroidComponents.kt)
    actions:
      review:
        type: APPROVE
        message: 🚢
      queue:
        method: rebase
        name: default
        rebase_fallback: none
      delete_head_branch:
        force: false
  - name: Needs landing - Rebase
    conditions:
      - check-success=pr-complete
      - label=pr:needs-landing
      - "#approved-reviews-by>=1"
      - -draft
      - label!=pr:work-in-progress
      - label!=pr:do-not-land
    actions:
      queue:
        method: rebase
        name: default
        rebase_fallback: none
  - name: Needs landing - Squash
    conditions:
      - check-success=pr-complete
      - label=pr:needs-landing-squashed 
      - "#approved-reviews-by>=1"
      - -draft
      - label!=pr:work-in-progress
      - label!=pr:do-not-land
    actions:
      queue:
        method: squash
        name: default
        rebase_fallback: none
