Skip to content

Commit 6d42cec

Browse files
authored
fix: target correct base branch for docker-versions PR (#1848)
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.
1 parent fbed4e9 commit 6d42cec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/github-docker-registry-push.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ jobs:
5757
else
5858
git commit -m "Update Docker versions"
5959
git push origin docker-versions-update
60-
echo 'y' | gh pr create --fill
60+
# Create PR targeting the same branch where this workflow is running
61+
BASE_BRANCH="${GITHUB_REF#refs/heads/}"
62+
echo 'y' | gh pr create --fill --base "$BASE_BRANCH"
6163
fi
6264
6365
- name: Check for Dockerfile and context changes

0 commit comments

Comments
 (0)