Skip to content

ci: update PR branches after main changes - #376

Draft
rng1995 wants to merge 1 commit into
mainfrom
naren/auto-update-pr-branches
Draft

ci: update PR branches after main changes#376
rng1995 wants to merge 1 commit into
mainfrom
naren/auto-update-pr-branches

Conversation

@rng1995

@rng1995 rng1995 commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a GitHub Actions workflow that runs after pushes to main and can also be dispatched manually
  • enumerate all open PRs targeting main and queue GitHub's update-branch API for eligible repository-hosted head branches
  • serialize update runs, use least-privilege write permissions, and report queued/skipped/failed counts
  • keep the DCO check compatible by exempting only GitHub-generated merge commits while continuing to require sign-off on contributor commits

Why

Open PR branches fall behind whenever changes land on main. GitHub's update-branch API safely merges the latest base into eligible PR head branches, but its generated merge commits do not contain a DCO trailer. Without the narrow DCO exemption, automatic branch updates would make otherwise valid PRs fail the repository's custom DCO check.

Scope and limitation

The repository GITHUB_TOKEN cannot write head branches stored in contributor forks, so those PRs are explicitly skipped with a workflow notice. At implementation time, 2 of 39 open PRs used repository-hosted branches; the other 37 used forks. No personal token or repository secret is introduced.

Validation

  • parsed both changed workflow files as YAML
  • syntax-checked both embedded Bash scripts
  • ran git diff --check
  • exercised the PR enumeration query read-only against all 39 current open PRs
  • verified DCO classification for a GitHub-generated merge, an unsigned contributor merge, and a signed contributor commit

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant