Skip to content

gh release create <tag> --latest=false does not work when uploading assets #8201

@MatBon01

Description

@MatBon01

Describe the bug

gh version 2.36.0 (2023-10-03)
When creating a release the option --latest=false has no effect if you upload assets in the same command.

Steps to reproduce the behavior

# setup an existing github repository with an existing release
echo "hello" > hello.txt
git tag test-release
git push --tags

# create release (generate title for ease)
gh release create test-release --latest=false --generate-notes hello.txt

Observe in the releases that it is still marked as latest.

Expected vs actual behavior

We expect this release (when other releases are present) to not be marked as the latest release when in fact it is being marked as the latest release.

Logs

From running the above:

Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 20 threads
Compressing objects: 100% (1/1), done.
Writing objects: 100% (2/2), 251 bytes | 251.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/MatBon01/test-actions.git
 * [new tag]         test-release -> test-release
https://github.com/MatBon01/test-actions/releases/tag/test-release

Ideas

Looking at the code an asset is uploaded by creating a draft release. Perhaps the default behaviour when publishing a release from draft is to set it as latest and the overriding option is not being passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-releaserelating to the gh release commandhelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions