Automatic Merge to Respository


I am new to using GitHub actions and I create a workflow for Node.js, and I have been looking around but I haven’t been able to find out how to set-up my .yaml so that after running all the tests if they pass it automatically merges the pull-requests back to the master repository. Can somebody help me please?

You could use something like this action:

With a step condition (after your tests):
if: success()


You can reference to the following demo to configure your workflow:

on: pull_request

    . . .
    needs: [build]
    . . .

    needs: [build, test]
    runs-on: ubuntu-latest
      - name: Auto-merge PR
        uses: <an action to auto-merge PR>
# In this step you can execute an action to auto-merge the PR.
# I find some related actions from the GitHub Marketplace, 
# see "".
# You can use one of them in this step to auto-merge the PR.