name: Auto Assign to Project

on:
  issues:
    types: [labeled]
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  assign_one_project:
    runs-on: ubuntu-latest
    name: Assign to One Project
    steps:
    - name: Assign issues with `up for grabs` label to project `Datree`
      uses: srggrs/assign-one-project-github-action@1.2.1
      if: |
        contains(github.event.issue.labels.*.name, 'up for grabs')
      with:
        project: 'https://github.com/datreeio/datree/projects/2'
        column_name: 'To Do'
