fix(ci): prevent dirty git state in release workflow#36
Open
miguelsanchez-upsun wants to merge 1 commit intomainfrom
Open
fix(ci): prevent dirty git state in release workflow#36miguelsanchez-upsun wants to merge 1 commit intomainfrom
miguelsanchez-upsun wants to merge 1 commit intomainfrom
Conversation
The workflow was using sed to modify .goreleaser.yaml when upload_taps was enabled, causing GoReleaser to fail with "git is in a dirty state". Changed to use environment variable SKIP_UPLOAD_TAPS with GoReleaser's envOrDefault template function. This preserves the same GitHub UI checkbox behavior while avoiding file modifications during the pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the release pipeline to avoid modifying tracked files during a run (which caused GoReleaser “dirty git state” validation failures) by switching tap upload control from an in-place sed edit to an environment-driven GoReleaser template.
Changes:
- Replace
skip_upload: autoliterals in.goreleaser.yamlwith anenvOrDefaulttemplate readingSKIP_UPLOAD_TAPS. - Remove the workflow step that edited
.goreleaser.yamlin-place withsed. - Set
SKIP_UPLOAD_TAPSin the release workflow based on theupload_tapsinput.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.goreleaser.yaml |
Makes tap/scoop skip_upload configurable via environment instead of a committed-file edit. |
.github/workflows/release.yml |
Eliminates in-workflow file mutation and sets SKIP_UPLOAD_TAPS for make release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Fixes the "git is in a dirty state" error that occurs when running the release workflow with
upload_reposenabled.The workflow was using
sedto modify.goreleaser.yamlin-place when theupload_tapscheckbox was enabled, causing GoReleaser to detect modified files and fail validation.Solution: Replace file modification with environment variable approach:
envOrDefaulttemplate function to readSKIP_UPLOAD_TAPSfrom environmentupload_tapsinputTest plan
upload_tapscheckbox (should useauto)upload_tapscheckbox enabled (should usefalse)🤖 Generated with Claude Code