简体   繁体   中英

Github actions merge specific pull request

What i need is to merge a pull request opened previously by the same Github Action, but i need to merge only that specific pull request as for example if x is editing file y in feature 1 and open a pull request i don't want that one to be merged. If the Github actions create a pull request as in the example below i need it to merge only the one created by itself or by specific pull request name.

Are there any solutions to this?

merge-branch:
    if: ${{ github.event.label.name == 'commit' }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: test1
        uses: devmasx/merge-branch@v1.3.1
        with:
          type: now
          from_branch: feature1
          target_branch: master
          github_token: ${{ github.token }}

If you want to approve specific PRs by username:

You could use an auto-approve action that would only approve pull request from the github-actions [bot] , and then an auto-merge action to merge only pull request with a specific label or when they are approved.

If you want to approve specific PRs by name:

You could use the if conditional in your workflow to check if the title or the prefix contains or is equal to a specific field through github.event.pull_request.title . There is also this action ( check-pull-request-title ) that might help to perform the same operation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM