on:
  pull_request_target:
    types: [ opened, synchronize ]

permissions: {}
jobs:
  test:
    permissions:
      contents: write
      pull-requests: write

    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
    steps:
    - name: Checkout repo for OWNER TEST
      uses: actions/checkout@v4
      if: contains(github.event.pull_request.labels.*.name, 'safe to test')
      with:
        ref: ${{ github.event.pull_request.head.ref }}
    - run: |
        ./cmd
