diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index cc7f6f7817..6022a278c2 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -88,19 +88,13 @@ jobs: buildOnly: ${{ github.event.pull_request.head.repo.owner.login != 'Lundalogik' || github.actor == 'dependabot[bot]' || github.event_name == 'merge_group' }} secrets: inherit - autoapprove: + automerge: needs: [lint, build, test, autosquash, docs] - # Only run job if the PR comes from a repo owned by Lime and the PR was - # created by Dependabot. + permissions: + contents: write + pull-requests: write if: github.event.pull_request.head.repo.owner.login == 'Lundalogik' && github.actor == 'dependabot[bot]' && github.event_name != 'merge_group' runs-on: ubuntu-latest steps: - - name: Enable Automerge - run: gh pr merge --auto --rebase "$PR_URL" - env: - PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.ENABLE_AUTOMERGE }} - - name: Autoapprove - uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 - with: - github-token: ${{ secrets.APPROVE_AUTOMATIC_PRS }} + - name: Automerge + run: "curl -L -X PUT -H \"Accept: application/vnd.github+json\" -H \"Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}\" -H \"X-GitHub-Api-Version: 2022-11-28\" https://api.github.com/repos/Lundalogik/lime-elements/pulls/${{ github.event.pull_request.number }}/merge -d '{\"merge_method\":\"rebase\"}'"