Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize auto approval workflow #5328

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

pull-request-number: ${{ github.event.issue.number }}
github-token: ${{ secrets.PYVISTA_BOT_TOKEN }}