# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license

# Ultralytics Contributor License Agreement (CLA) action https://docs.ultralytics.com/help/CLA
# This workflow automatically requests Pull Requests (PR) authors to sign the Ultralytics CLA before PRs can be merged

name: CLA
on:
  issue_comment:
    types:
      - created
  pull_request_target:
    types:
      - reopened
      - opened
      - synchronize

permissions:
  contents: read
  actions: write
  pull-requests: write

jobs:
  CLA:
    if: github.event_name == 'pull_request_target' || (github.event.issue.pull_request && (github.event.comment.body == 'recheck' || contains(github.event.comment.body, 'I have read the CLA Document and I sign the CLA')))
    concurrency:
      group: cla-${{ github.event.pull_request.number || github.event.issue.number }}
    runs-on: ubuntu-latest
    steps:
      - name: CLA
        uses: ultralytics/actions/cla@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          cla-token: ${{ secrets._GITHUB_TOKEN }}
