name: Automate Projects

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

jobs:
  assign_one_project:
    runs-on: ubuntu-latest
    name: Assign to One Project
    steps:
    - name: Assign NEW bugs to triage
      uses: srggrs/assign-one-project-github-action@1.2.0
      if: contains(github.event.issue.labels.*.name, 'bug')
      with:
        project: 'https://github.com/pypeclub/pype/projects/2'
        column_name: 'Needs triage'
