Skip to content

sync-release-branch: Run from master against selected release#7101

Merged
thaJeztah merged 2 commits into
docker:masterfrom
vvoland:sync-master
Jul 10, 2026
Merged

sync-release-branch: Run from master against selected release#7101
thaJeztah merged 2 commits into
docker:masterfrom
vvoland:sync-master

Conversation

@vvoland

@vvoland vvoland commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

sync-release-branch: Run from master against selected release

The workflow previously inferred its target from the dispatch ref, requiring operators to always sync the release branch with the workflow/scripts on master.

Accept the release branch as an input, keep the dispatched master checkout as the script source, and merge in a detached worktree at the selected release revision.

gha/sync-release-branch: Add workflows write permission

See https://docker.slack.com/archives/C08453R6RV4/p1783680790750159

Without it GitHub rejects the push:

refusing to allow a GitHub App to create or update workflow `.github/workflows/build.yml` without `workflows` permission

@vvoland vvoland self-assigned this Jul 10, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vvoland vvoland added this to the 29.7.0 milestone Jul 10, 2026

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

One security-category finding was confirmed: the new release_branch workflow input is validated only against the literal string "master", but the value is used directly in git push origin "FETCH_HEAD:$RELEASE_BRANCH". A dispatcher with repository write access can bypass the guard using a full refname (e.g. refs/heads/master) and push the synced commit to an unintended branch. Recommend adding a strict pattern match (e.g. ^[0-9]+\.[x0-9]+$) in the Validate step.

Comment thread .github/workflows/sync-release-branch.yml
vvoland added 2 commits July 10, 2026 13:49
The workflow previously inferred its target from the dispatch ref,
requiring operators to always sync the release branch with the
workflow/scripts on master.

Accept the release branch as an input, keep the dispatched master
checkout as the script source, and merge in a detached worktree at the
selected release revision.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Without it GitHub rejects the push:

```
refusing to allow a GitHub App to create or update workflow `.github/workflows/build.yml` without `workflows` permission
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The workflow refactor is logically correct: the branch check inversion, worktree-based script isolation, and inputs.release_branch threading all look sound. One minor validation note below.

Comment thread .github/workflows/sync-release-branch.yml

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit 1423089 into docker:master Jul 10, 2026
109 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants