diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 9ee28a6b84..d3707d65c3 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -2,25 +2,24 @@ name: Approve PRs on: workflow_dispatch: issue_comment: - types: [created, edited] - -env: - # sintax: ("tkoyama010" "author2") - ALLOWED_AUTHORS: ("tkoyama010", "banesullivan", "akaszynski") + types: [created] jobs: autoapprove: - # This job only runs for pull request comments + # This job only runs for pull request comments by approved users on creation name: PR comment - if: ${{ github.event.issue.pull_request }} + if: github.event.issue.pull_request && + contains(github.event.comment.body, '@pyvista-bot LGTM') && ( + github.event.comment.user.login == 'banesullivan' || + github.event.comment.user.login == 'tkoyama010' || + github.event.comment.user.login == 'akaszynski' + ) permissions: pull-requests: write runs-on: ubuntu-latest steps: - uses: hmarr/auto-approve-action@v3 - if: | - contains(github.event.comment.body, '@pyvista-bot LGTM') && contains(env.ALLOWED_AUTHORS, github.event.comment.user.login) with: - review-message: ":white_check_mark: Approving this PR because [${{ github.event.comment.user.login }}](https://github.com/${{ github.event.comment.user.login }}) said so in [here](${{ github.event.comment.html_url }}) :grimacing:" + review-message: ":white_check_mark: Approving this PR because [${{ github.event.comment.user.login }}](https://github.com/${{ github.event.comment.user.login }}) said so in [here](${{ github.event.comment.html_url }}) :shipit:" pull-request-number: ${{ github.event.issue.number }} github-token: ${{ secrets.PYVISTA_BOT_TOKEN }}