Skip to content

Conversation

@gounthar
Copy link
Collaborator

Summary

Fixes the docker-versions-update workflow to create PRs against the correct base branch instead of always targeting main.

Problem

PR #1847 demonstrates the issue: the workflow runs on the weekly branch, creates a docker-versions-update branch from weekly, but then creates a PR targeting main (the repo's default branch). This results in a PR trying to merge the entire weekly branch history into main - hundreds of commits that should never be merged.

Root Cause

In .github/workflows/github-docker-registry-push.yml, the step "Commit and create PR for Docker versions" uses:

gh pr create --fill

Without specifying --base, this defaults to the repository's default branch (main), regardless of which branch the workflow is running on.

Solution

Extract the current branch from GITHUB_REF and explicitly pass it as the base branch:

BASE_BRANCH="${GITHUB_REF#refs/heads/}"
gh pr create --fill --base "$BASE_BRANCH"

This ensures docker-versions updates create PRs back to the same branch they're running on (weekly→weekly, main→main, etc.).

Impact

  • Prevents creation of massive cross-branch PRs like docker versions update #1847
  • Ensures docker-versions updates stay within their respective branch contexts
  • Workflow continues to work on all branches (main, weekly, feature branches)

Related

The workflow was creating PRs against the default branch (main) instead of
the branch where it was running. When running on weekly, this caused PRs
trying to merge the entire weekly history into main.

Now extracts the current branch from GITHUB_REF and uses it as the base
branch for the PR, ensuring docker-versions updates stay on the same branch.
@gounthar gounthar mentioned this pull request Nov 14, 2025
@github-actions github-actions bot added the repo label Nov 14, 2025
@gounthar gounthar merged commit 6d42cec into jenkins-docs:weekly Nov 14, 2025
3 of 4 checks passed
@gounthar gounthar deleted the fix-docker-versions-pr-workflow branch November 14, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant