Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/scripts/automerge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ pr() {

reviews=$(gh api --paginate --slurp "repos/$repository/pulls/$number/reviews?per_page=100" | jq '[.[][]]')
# A reviewer's standing verdict is their latest approval, change request or dismissal; comments do not change it.
blocked=$(jq -r '[.[] | select(.state == "APPROVED" or .state == "CHANGES_REQUESTED" or .state == "DISMISSED")]
| group_by(.user.login) | map(last | select(.state == "CHANGES_REQUESTED") | .user.login) | join(", ")' <<< "$reviews")
# The review bot's logins are one reviewer, and every review of its is a verdict, so its latest one stands.
blocked=$(jq -r --arg bots "$BOTS" '($bots | split(" ")) as $bots
| [.[] | (.user.login as $login | $bots | index($login) != null) as $bot
| select(.state == "APPROVED" or .state == "CHANGES_REQUESTED" or .state == "DISMISSED" or ($bot and .state == "COMMENTED"))
| .reviewer = (if $bot then $bots[0] else .user.login end)]
| group_by(.reviewer) | map(last | select(.state == "CHANGES_REQUESTED") | .reviewer) | join(", ")' <<< "$reviews")
if [ -n "$blocked" ]; then
echo "$log: skip, changes requested by $blocked"; return
fi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The `automerge` workflow runs every 30 minutes and merges a Renovate PR only whe

1. The PR is authored by `renovate-appwrite[bot]`, open, not a draft, has no conflicts, and its repository is covered by the runner (the same exclusions, forks and split mirrors as `plan`).
2. CI passed: at least one check run or commit status exists (a repository without CI never auto-merges; skipped check runs and the verify workflow's `detect projects` job do not count), no check run is pending, every check run concluded success, skipped or neutral, and the combined commit status is success. Review bot check runs (Hansi, Tenki) are verdicts, not CI, so they are left out of this step and a non-S Hansi tier does not block a maintainer's approval.
3. It is approved: an `APPROVED` review on the head commit from the review bot (`appwrite[bot]`, formerly `hansi-codes[bot]`) or from a user with write, maintain or admin access, or the review bot's `Hansi` check reporting Tier S on the head commit. A major update, including a security fix that needs one, only counts a user's approval. No reviewer's latest review requests changes.
3. It is approved: an `APPROVED` review on the head commit from the review bot (`appwrite[bot]`, formerly `hansi-codes[bot]`) or from a user with write, maintain or admin access, or the review bot's `Hansi` check reporting Tier S on the head commit. A major update, including a security fix that needs one, only counts a user's approval. No reviewer's latest review requests changes; the review bot's two logins count as one reviewer, whose latest review of any kind stands.

It then merges with the org's app token, squashing if the repository and its branch rulesets allow it, else with a merge commit, else by rebase, and passes `--match-head-commit` so a push in between stops the merge. Branch protection still applies: a refused merge is logged as a warning and retried on the next run. Every PR gets one log line with the decision and the reason.

Expand Down
Loading