name: pr_maintainer_checklist
on:
  pull_request_target:
    branches:
      - main
    types:
      - opened

jobs:
  add_pr_checklist:
    runs-on: ubuntu-latest
    name: Add PR Maintainer Checklist
    permissions:
      pull-requests: write
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Comment PR
        uses: thollander/actions-comment-pull-request@v2
        with:
          message: |
            ## Thank you for the pull request!

            The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

            If you're not already a member of our [public Matrix community](https://matrix.to/#/#scribe_community:matrix.org), please consider joining! We'd suggest using [Element](https://element.io/) as your Matrix client, and definitely join the General and i18n rooms once you're in. Also consider joining our [bi-weekly Saturday dev syncs](https://etherpad.wikimedia.org/p/scribe-dev-sync). It'd be great to have you!

      - name: First PR Contributor Email Check
        id: first_interaction
        uses: actions/first-interaction@v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          pr-message: |
            ## First PR Commit Check

            - [ ] The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution
              - The contributor's name and icon in remote commits should be the same as what appears in the PR
              - If there's a mismatch, the contributor needs to make sure that the [email they use for GitHub](https://github.com/settings/emails) matches what they have for `git config user.email` in their local activist repo
          
