Skip to content

chore(deps): update github/codeql-action action to v4.37.2 (#1183) #243

chore(deps): update github/codeql-action action to v4.37.2 (#1183)

chore(deps): update github/codeql-action action to v4.37.2 (#1183) #243

Workflow file for this run

# Auto-update open PRs targeting testing when testing advances.
# Prevents the BEHIND state that blocks auto-merge from triggering.
# Runs after every push to testing (including merge-queue squash commits).
# Non-destructive: gh pr update-branch merges testing in; conflicts stay open.
name: PR Auto-update
on:
push:
branches:
- testing
concurrency:
group: pr-autoupdate
cancel-in-progress: true
jobs:
update-stale-prs:
name: Update stale PRs targeting testing
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
steps:
- name: Find and update stale PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
# Find all open PRs targeting testing that are BEHIND and need updating.
# Renovate manages its own branch updates — skip them.
# Mergeraptor PRs (distrobox, junction bumps) DO target testing and need auto-update
# so renovate-automerge can fire. They are intentionally included here.
STALE_PRS=$(gh pr list \
--repo "$REPO" \
--base testing \
--state open \
--json number,headRefName,mergeStateStatus,author \
--jq '
.[] |
select(.mergeStateStatus == "BEHIND") |
select(.author.login != "renovate[bot]") |
.number
')
if [ -z "$STALE_PRS" ]; then
echo "No stale PRs found — nothing to do"
exit 0
fi
echo "Stale PRs to update: $(echo "$STALE_PRS" | tr '\n' ' ')"
UPDATED=0
SKIPPED=0
for PR_NUM in $STALE_PRS; do
if gh pr update-branch "$PR_NUM" --repo "$REPO" 2>/dev/null; then
echo " ✅ PR #${PR_NUM} updated"
UPDATED=$((UPDATED + 1))
else
echo " ⚠️ PR #${PR_NUM} skipped (already up-to-date or merge conflict)"
SKIPPED=$((SKIPPED + 1))
fi
done
echo "Done — updated: ${UPDATED}, skipped: ${SKIPPED}"