auto-approve-action icon indicating copy to clipboard operation
auto-approve-action copied to clipboard

Support auto approving based on a string pattern in PR title

Open pkgajulapalli opened this issue 1 year ago • 3 comments

pkgajulapalli avatar Aug 01 '24 11:08 pkgajulapalli

This action just does the approval. If you want to do something like this, you just need to write a workflow that does what you want.

Here's an untested workflow that might do what you want (and might also result in someone taking over your repository, please don't trust the words of random people without actually understanding everything that they're suggesting):

name: Conditional Approval
on:
  pull_request:
    types:
    - created
    - edited
    - reopened
  
jobs:
  approve:
    permissions:
      pull-requests: write
    if: contains(github.event.pull_request.title, '[RUBBER-STAMP]')
    name: Approve
    runs-on: ubuntu-latest
    steps:
    - name: Approve
      uses: hmarr/auto-approve-action@v4

jsoref avatar Jan 27 '25 21:01 jsoref

@pkgajulapalli Actually, there is an Action for that :D It's a fork of this repo action with the ability to trigger auto-approve only on specific "ship" keywords, also supports custom automatic approve messages, etc. But @jsoref workflow will work too 👍🏻

tsinis avatar Jan 27 '25 21:01 tsinis

@tsinis interesting.

Fwiw, I'm surveying the landscape because I've been asked about doing something for a project, and I'm currently trying to understand why I shouldn't just use gh pr review ....

jsoref avatar Jan 27 '25 21:01 jsoref