github.pullRequests stopped working

I had a working script and it stopped working. I didn’t have any notice or warning of a change in Actions.

I was using:

    name: Merge Dependabot pull request
    runs-on: ubuntu-latest
    if: github.base_ref == 'master' && == 'dependabot[bot]'
      - uses: actions/github-script@v2
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
              owner: context.repo.owner,
              repo: context.repo.repo,
              pull_number: context.payload.pull_request.number

Now it seems by the documentation github.pullRequests don’t exist anymore and I get the error: Unhandled error: TypeError: Cannot read property 'merge' of undefined.

Any hints here?

@staticdev Please use github.pulls.merge .
In actions/github-script@v2, github object is a pre-authenticated octokit/rest.js client.
According to , pull request merge function is this :

1 Like

That worked as charm! Thanks a lot @yanjingzhu!

1 Like