name: 'Check Mergeable by Label'

on:
  pull_request:
    types:
      - opened
      - reopened
      - synchronize
      - edited
      - labeled
      - unlabeled

jobs:
  fail-by-label:
    if: contains(github.event.pull_request.labels.*.name, 'Pending Ratification')
    runs-on: ubuntu-latest
    steps:
      - name: Fail if PR is labeled "Pending Ratification"
        run: |
          echo "Error: This PR is labeled as 'Pending Ratification' and cannot be merged."
          exit 1
