diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml index 3edeaa4..7315fcd 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/auto-merge-dependabot.yml @@ -9,19 +9,20 @@ jobs: if: github.actor == 'dependabot[bot]' steps: - - name: automerge - uses: actions/github-script@0.2.0 + - name: Automerge + uses: actions/github-script@latest with: script: | - github.pullRequests.createReview({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, + console.log("Context: ", context); + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, pull_number: context.payload.pull_request.number, event: 'APPROVE' - }) - github.pullRequests.merge({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, + }); + await github.pulls.merge({ + owner: context.repo.owner, + repo: context.repo.repo, pull_number: context.payload.pull_request.number - }) - github-token: ${{github.token}} + }); + github-token: ${{ secrets.GITHUB_TOKEN }}