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
32 changes: 30 additions & 2 deletions .github/workflows/dependabot-rebase-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,37 @@ jobs:

if [[ "$BEHIND" -gt 0 ]]; then
echo "PR #$PR_NUMBER ($HEAD_REF) is $BEHIND commit(s) behind — merging main into branch"
gh api "repos/$REPO/pulls/$PR_NUMBER/update-branch" \
if gh api "repos/$REPO/pulls/$PR_NUMBER/update-branch" \
-X PUT -f update_method=merge \
--silent || echo "Warning: failed to update PR #$PR_NUMBER"
--silent; then
echo " Branch updated"
# Only re-approve if auto-merge is enabled. Auto-merge is set exclusively
# by the dependabot-automerge workflow after confirming eligibility (patch/
# minor updates or GitHub Actions). This guards against re-approving PRs
# that the policy intentionally leaves for human review (e.g. major non-
# Actions updates).
#
# Note: update-branch creates a merge commit authored by GitHub's
# infrastructure (not the app token), so require_last_push_approval is
# satisfied when the app re-approves — the pusher and approver are
# different identities.
AUTO_MERGE_ENABLED=$(gh pr view "$PR_NUMBER" --repo "$REPO" \
--json autoMergeRequest --jq '.autoMergeRequest != null')
if [[ "$AUTO_MERGE_ENABLED" == "true" ]]; then
echo " Re-approving to refresh stale approval"
if gh pr review "$PR_NUMBER" --repo "$REPO" --approve \
--body "Re-approved after branch update to keep up-to-date with main." \
--silent; then
echo " Re-approved PR #$PR_NUMBER"
else
echo " Warning: failed to re-approve PR #$PR_NUMBER — PR will remain blocked until manually re-approved"
fi
else
echo " Skipping re-approval — auto-merge not enabled (PR may require human review)"
fi
else
echo "Warning: failed to update PR #$PR_NUMBER"
fi
continue
fi

Expand Down
2 changes: 1 addition & 1 deletion standards/github-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ rules are deprecated — migrate existing classic rules to rulesets.
| **Dismiss stale reviews on push** | **Yes** — prevents merging unreviewed code after approval |
| **Required review thread resolution** | **Yes** — all threads must be Resolved before merge |
| **Require code owner review** | **Yes** — requires approval from a CODEOWNERS-defined owner |
| **Require last push approval** | **Yes** — the person who pushed last cannot be the sole approver |
| **Require last push approval** | **Yes** — ensures different people review substantive code changes; Dependabot rebase workflow re-approves after branch updates to maintain approval validity |
Comment thread
don-petry marked this conversation as resolved.
| **Allowed merge methods** | **Squash only** |
| **Allow force pushes** | No |
| **Allow deletions** | No |
Expand Down
Loading