Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

ci(bots): only auto-merge Renovate PRs it marks for automerge (#7342)

Thomas8e6a93e206a0
diff --git a/.github/workflows/bot-auto-merge-reconcile.yml b/.github/workflows/bot-auto-merge-reconcile.yml
index c7bbbabf1..58eb9d561 100644
--- a/.github/workflows/bot-auto-merge-reconcile.yml
+++ b/.github/workflows/bot-auto-merge-reconcile.yml
@@ -37,9 +37,16 @@ jobs:
# 210161987: homarr-update-contributors[bot]
# 175441: homarr-releases[bot]
gh pr list --repo "${{ github.repository }}" --base dev --state open --limit 100 \
- --json number,author,reviewDecision,mergeStateStatus,autoMergeRequest \
- --jq '.[] | select(.author.login as $login | ["app/homarr-renovate", "app/homarr-crowdin", "app/homarr-update-contributors", "app/homarr-releases"] | index($login)) | select(.reviewDecision == "APPROVED") | select(.mergeStateStatus == "CLEAN") | select(.autoMergeRequest == null) | .number' \
+ --json number,author,body,reviewDecision,mergeStateStatus,autoMergeRequest \
+ --jq '.[] | select(.author.login as $login | ["app/homarr-renovate", "app/homarr-crowdin", "app/homarr-update-contributors", "app/homarr-releases"] | index($login)) | select(.author.login != "app/homarr-renovate" or (.body | contains("**Automerge**: Enabled"))) | select(.reviewDecision == "APPROVED") | select(.mergeStateStatus == "CLEAN") | select(.autoMergeRequest == null) | .number' \
| while read -r pr; do
echo "Re-enabling auto-merge on PR #$pr"
gh pr merge "$pr" --auto --squash
done
+ gh pr list --repo "${{ github.repository }}" --base dev --state open --author app/homarr-renovate --limit 100 \
+ --json number,body,autoMergeRequest \
+ --jq '.[] | select(.body | contains("**Automerge**: Enabled") | not) | select(.autoMergeRequest != null) | .number' \
+ | while read -r pr; do
+ echo "Disabling auto-merge on manual-review Renovate PR #$pr"
+ gh pr merge "$pr" --disable-auto
+ done
diff --git a/.github/workflows/bot-pr-automerge.yml b/.github/workflows/bot-pr-automerge.yml
index 39940f2e4..b51931608 100644
--- a/.github/workflows/bot-pr-automerge.yml
+++ b/.github/workflows/bot-pr-automerge.yml
@@ -41,6 +41,13 @@ jobs:
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
run: |
PR_NUMBER="${{ github.event.pull_request.number }}"
+ if [ "${{ github.actor_id }}" = "158783068" ] && ! gh pr view "$PR_NUMBER" --json body --jq .body | grep -qF '**Automerge**: Enabled'; then
+ echo "Renovate automerge is disabled for PR #$PR_NUMBER; leaving it for manual review"
+ if [ "$(gh pr view "$PR_NUMBER" --json autoMergeRequest --jq '.autoMergeRequest != null')" = "true" ]; then
+ gh pr merge "$PR_NUMBER" --disable-auto
+ fi
+ exit 0
+ fi
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