Resolves issue creating release with 'prerelease' tag#6392
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #6391 by correcting how boolean flags are passed to the GitHub CLI when creating releases. The previous implementation incorrectly passed boolean flags with values (e.g., --prerelease true), but the GitHub CLI expects boolean flags to be passed without values (e.g., --prerelease). The PR also includes an unrelated improvement to ensure binary file executability after copying.
Key Changes:
- Fixed boolean flag handling in GitHub release creation to pass flags without values
- Added execute permissions to copied extension binaries to ensure they are executable
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cli/azd/extensions/microsoft.azd.extensions/internal/github/github.go | Refactored CreateRelease to separate boolean flags (prerelease, draft) from value-based flags, ensuring GitHub CLI receives correct flag format |
| cli/azd/extensions/microsoft.azd.extensions/internal/cmd/build.go | Added os.Chmod call to set execute permissions (0755) on copied binary files |
Comments suppressed due to low confidence (1)
cli/azd/extensions/microsoft.azd.extensions/internal/github/github.go:184
- The CreateRelease function has been modified to fix a critical bug with boolean flag handling, but there are no tests covering this functionality. Consider adding tests to verify that:
- Boolean flags like 'prerelease' and 'draft' are correctly added without values when set to "true"
- Boolean flags are not added to the command when set to other values or not present
- Non-boolean flags continue to work correctly with their values
This would prevent regressions in the future and document the expected behavior.
func (gh *GitHubCli) CreateRelease(cwd string, tagName string, opts map[string]string, assets []string) (*Release, error) {
args := []string{"release", "create", tagName}
// Define boolean flags that should be added without values
booleanFlags := map[string]bool{"prerelease": true, "draft": true}
// Add optional arguments (skip boolean flags)
for key, value := range opts {
if value != "" && !booleanFlags[key] {
args = append(args, fmt.Sprintf("--%s", key), value)
}
}
// Add boolean flags (without values)
for flag := range booleanFlags {
if value, ok := opts[flag]; ok && value == "true" {
args = append(args, fmt.Sprintf("--%s", flag))
}
}
JeffreyCA
approved these changes
Dec 17, 2025
Copilot AI
added a commit
that referenced
this pull request
Dec 17, 2025
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
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.
Resolves #6391
--prereleaseflagbuildsets executable permissions for use on POSIX systems