Skip to content

Commit

Permalink
ci(pr-checks.yml): update automerge job for use with rulesets
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschmidt committed Nov 15, 2024
1 parent 31302a8 commit 33ad0f8
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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\"}'"

0 comments on commit 33ad0f8

Please sign in to comment.