+12








fcd7c979df
Co-authored-by: Artur <145776561+arturict@users.noreply.github.com> Co-authored-by: arturict <arturict@users.noreply.github.com> Co-authored-by: Thomas <thomas@ajnart.fr> Co-authored-by: Afonso Jorge Ramos <afonsojorgeramos@gmail.com> Co-authored-by: Danura30082 <danura30082+github@gmail.com> Co-authored-by: Kushie <122986913+kushiemoon-dev@users.noreply.github.com> Co-authored-by: ajnart <thomas@ajnart.fr> Co-authored-by: ajnart <thomas@ajnart.dev> Co-authored-by: chenjun <chenjun@foxmail.com> Co-authored-by: Wikibear <wikibear@users.noreply.github.com> Co-authored-by: Bergasha <bergasha@gmail.com> Co-authored-by: leafyelin <43306196+leafyelin@users.noreply.github.com> Co-authored-by: Lucas Araujo <lucas.lra@gmail.com> Co-authored-by: GreenMonito <86085570+GreenMonito@users.noreply.github.com> Co-authored-by: Nerdy-Technician <roffo@nerdy-technician.social> Co-authored-by: Jun <34545896+jcstrong@users.noreply.github.com> Co-authored-by: Edmond Abraham <54119952+gitedmond@users.noreply.github.com> Co-authored-by: thrawnx <tight.bulb9384@fastmail.com> Co-authored-by: Chris <58918656+nordada@users.noreply.github.com> Co-authored-by: yi111 <153097222+Yi-111-a@users.noreply.github.com> Co-authored-by: Yanis <naamaneyanis@gmail.com> Co-authored-by: Wikibear <me@sej.de> Co-authored-by: alessiottavo <93441886+alessiottavo@users.noreply.github.com>
48 lines
1.8 KiB
YAML
48 lines
1.8 KiB
YAML
name: "[Bots] Approve and Auto-merge"
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
approve-and-automerge:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
# 158783068: homarr-renovate[bot]
|
|
# 190541745: homarr-crowdin[bot]
|
|
# 210161987: homarr-update-contributors[bot]
|
|
# 175441: homarr-releases[bot]
|
|
# Extracted from https://api.github.com/users/<username>
|
|
if: |
|
|
(github.actor_id == 158783068 || github.actor_id == 190541745 || github.actor_id == 210161987 || github.actor_id == 175441) &&
|
|
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
github.event.pull_request.base.ref == 'dev'
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Obtain token
|
|
id: obtainToken
|
|
uses: actions/create-github-app-token@v3
|
|
with:
|
|
private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }}
|
|
client-id: ${{ vars.RENOVATE_APPROVE_CLIENT_ID }}
|
|
permission-pull-requests: write # required to approve a pull request and enable auto-merge
|
|
|
|
- name: Install GitHub CLI
|
|
run: sudo apt-get install -y gh
|
|
|
|
- name: Approve and enable auto-merge
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
|
run: |
|
|
PR_NUMBER="${{ github.event.pull_request.number }}"
|
|
if [ "$(gh pr view "$PR_NUMBER" --json reviewDecision --jq .reviewDecision)" != "APPROVED" ]; then
|
|
gh pr review "$PR_NUMBER" --approve --body "Automatically approved by Homarr bot policy"
|
|
fi
|
|
if [ "$(gh pr view "$PR_NUMBER" --json autoMergeRequest --jq '.autoMergeRequest != null')" != "true" ]; then
|
|
gh pr merge "$PR_NUMBER" --auto --squash
|
|
fi
|