# This workflow runs whenever a new pull request is created
# TEMPORARILY DISABLED. Unfortunately this doesn't work for PRs created from forked repositories (which is how we tend to create PRs).
# There is no known workaround yet. See https://github.community/t/how-to-use-github-token-for-prs-from-forks/16818
name: Pull Request opened

# Only run for newly opened PRs against the "main" branch
on: 
  pull_request:
    types: [opened]
    branches: 
      - main

jobs:
  automation:
    runs-on: ubuntu-latest
    steps:
    # Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
    # See https://github.com/marketplace/actions/pull-request-assigner
    - name: Assign PR to creator
      uses: thomaseizinger/assign-pr-creator-action@v1.0.0
      # Note, this authentication token is created automatically
      # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
      # Ignore errors. It is possible the PR was created by someone who cannot be assigned
      continue-on-error: true
