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

Support auto approving based on a string pattern in PR title #228

Open
pkgajulapalli opened this issue Aug 1, 2024 · 3 comments
Open

Support auto approving based on a string pattern in PR title #228

pkgajulapalli opened this issue Aug 1, 2024 · 3 comments

Comments

@pkgajulapalli
Copy link

No description provided.

@jsoref
Copy link
Contributor

jsoref commented Jan 27, 2025

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

@tsinis
Copy link

tsinis commented Jan 27, 2025

@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 👍🏻

@jsoref
Copy link
Contributor

jsoref commented Jan 27, 2025

@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 ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants