name: CLA Assistant

on:
  issue_comment:
    types: [created]
  pull_request_target:
    types: [opened, closed, synchronize]

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

jobs:
  CLAssistant:
    runs-on: ubuntu-latest
    steps:
      - name: CLA Assistant
        uses: contributor-assistant/github-action@v2.6.1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
        with:
          path-to-signatures: "signatures/cla.json"
          path-to-document: "https://github.com/ywatanabe1989/scitex-io/blob/main/CLA.md"
          branch: "cla-signatures"
          allowlist: bot*,ywatanabe1989
          custom-allsigned-prcomment: |
            Thank you for signing the SciTeX CLA. Your contribution can now be reviewed.
          custom-notsigned-prcomment: |
            Please sign the [SciTeX CLA](https://github.com/ywatanabe1989/scitex-io/blob/main/CLA.md) before your contribution can be merged.
            Comment `I have read and agree to the SciTeX CLA.` to sign.
