Fix duplicate checkout steps and minor cleanup#1
Conversation
Remove duplicate checkout actions (v2 after v3) in build.yaml and release.yml docker-build jobs. Add clarifying comment to Dockerfile ARG. Fix missing trailing newline in test-multiplatform.yaml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR performs cleanup operations on GitHub workflow files and adds documentation to the Dockerfile. It removes duplicate checkout steps that were using an older version of the actions/checkout action (v2) after already checking out with v3, adds tag sanitization to handle branch names with slashes in Docker image tags, and fixes formatting issues.
Changes:
- Removed duplicate
actions/checkout@v2steps in release.yml and build.yaml docker-build jobs - Added tag sanitization logic in build.yaml to replace slashes with hyphens in Docker image tags
- Added explanatory comment to Dockerfile about intentionally missing GO_VERSION default
- Fixed missing trailing newline in test-multiplatform.yaml
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Dockerfile | Added comment explaining GO_VERSION is intentionally provided via build-arg without a default |
| .github/workflows/test-multiplatform.yaml | Fixed missing trailing newline after the test step |
| .github/workflows/release.yml | Removed duplicate checkout@v2 step that followed checkout@v3 |
| .github/workflows/build.yaml | Removed duplicate checkout step, added tag sanitization to handle slashes in branch names for Docker images |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Sanitize tag | ||
| run: echo "TAG=${TAG//\//-}" >> $GITHUB_ENV |
There was a problem hiding this comment.
The tag sanitization step runs before the repository is checked out. This step doesn't require any repository files, but it's unusual to have logic run before checkout. Consider moving this step after the checkout step for better readability and conventional workflow ordering.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
.github/workflows/release.yml
Outdated
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Build Image | ||
| run: make image IMAGE=ghcr.io/${{env.REPO}}:${{ github.ref_name }} |
There was a problem hiding this comment.
In the release.yml workflow, the docker-build job uses github.ref_name directly without sanitization (line 104), while the build.yaml workflow now sanitizes it by replacing slashes with hyphens. Since release.yml only runs on tag pushes (tags matching 'v*'), which typically don't contain slashes, this inconsistency may not cause issues. However, for consistency and to handle edge cases where tags might contain slashes, consider applying the same sanitization pattern in release.yml.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@deweysasser I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@deweysasser I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you. |
Branch names with slashes (e.g. fix/foo) are invalid Docker tags. Replace slashes with dashes before using as image tag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
b87bf0c to
3ba4ba3
Compare
Summary
Test plan
🤖 Generated with Claude Code