feat: auto-update CAGENT_VERSION on new cagent releases#68
Merged
derekmisler merged 1 commit intodocker:mainfrom Mar 4, 2026
Merged
feat: auto-update CAGENT_VERSION on new cagent releases#68derekmisler merged 1 commit intodocker:mainfrom
derekmisler merged 1 commit intodocker:mainfrom
Conversation
Add workflow triggered by repository_dispatch (from dagent's release_cagent.yml) or manual workflow_dispatch to automatically update the CAGENT_VERSION file and create/update a PR. Key behaviors: - Validates version exists as a GitHub release before updating - Exits early if already up to date - Reuses a single PR branch (auto/update-cagent-version) so successive releases update the same PR instead of creating duplicates - Uses docker-agent GitHub App token with RELEASE_TOKEN fallback
Contributor
Author
|
/review |
There was a problem hiding this comment.
Review Summary
Assessment: 🟢 APPROVE
This PR introduces a new GitHub Actions workflow that automatically updates the CAGENT_VERSION file when new cagent releases are published. The implementation is well-structured with proper error handling and validation.
Key Features Reviewed:
- ✅ Version detection from repository_dispatch, workflow_dispatch, or latest release
- ✅ Release validation against docker/cagent repository
- ✅ Early exit if already up to date
- ✅ PR creation/update logic with force-push on managed branch
- ✅ Token fallback mechanism (App token → RELEASE_TOKEN → default)
Workflow Logic:
The workflow correctly handles the entire update cycle:
- Determines version from multiple sources with proper precedence
- Validates the version exists as a release
- Checks current version and exits early if unchanged
- Updates the file and creates/updates a PR on a fixed branch
- Uses force-push safely on an exclusively-managed branch
The code is production-ready. Several potential edge cases were examined (missing file checks, token validation, concurrent runs, variable injection) but were found to be either non-issues given the repository context or handled appropriately by the workflow's design.
No blocking issues found. The workflow follows GitHub Actions best practices and should work reliably in production.
trungutt
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update-cagent-version.yml) that automatically updatesCAGENT_VERSIONwhen a new cagent release is publishedrepository_dispatchfrom dagent'srelease_cagent.yml, or manually viaworkflow_dispatchdocker/cagentbefore updatingauto/update-cagent-version) so successive releases update the same PR instead of creating duplicatesRELEASE_TOKENfallbackCompanion change
The
repository_dispatchsender step still needs to be added todocker/dagent'srelease_cagent.yml(addscagent-actionto the app token repo list + a dispatch step at the end of the release job): https://github.com/docker/dagent/pull/328Test plan
workflow_dispatchwith no version input (should fetch latest release)v1.28.1)v1.28.1, thenv1.28.2before merging — same PR should update