Skip to content

Commit 33ad0f8

Browse files
committed
ci(pr-checks.yml): update automerge job for use with rulesets
1 parent 31302a8 commit 33ad0f8

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/pr-checks.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,13 @@ jobs:
8888
buildOnly: ${{ github.event.pull_request.head.repo.owner.login != 'Lundalogik' || github.actor == 'dependabot[bot]' || github.event_name == 'merge_group' }}
8989
secrets: inherit
9090

91-
autoapprove:
91+
automerge:
9292
needs: [lint, build, test, autosquash, docs]
93-
# Only run job if the PR comes from a repo owned by Lime and the PR was
94-
# created by Dependabot.
93+
permissions:
94+
contents: write
95+
pull-requests: write
9596
if: github.event.pull_request.head.repo.owner.login == 'Lundalogik' && github.actor == 'dependabot[bot]' && github.event_name != 'merge_group'
9697
runs-on: ubuntu-latest
9798
steps:
98-
- name: Enable Automerge
99-
run: gh pr merge --auto --rebase "$PR_URL"
100-
env:
101-
PR_URL: ${{ github.event.pull_request.html_url }}
102-
GITHUB_TOKEN: ${{ secrets.ENABLE_AUTOMERGE }}
103-
- name: Autoapprove
104-
uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
105-
with:
106-
github-token: ${{ secrets.APPROVE_AUTOMATIC_PRS }}
99+
- name: Automerge
100+
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\"}'"

0 commit comments

Comments
 (0)