axodotdev / axodotdev/cargo-dist

If the workflow creates a tag, use annotated tags

Open
#1,616 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

If `dispatch-releases = true` is set and a tag doesn't already exist, the tag for a release will be implicitly created by a call to `gh release create`. However, this doesn't generate annotated tags.

From `man git-tag`:

> Annotated tags are meant for release while lightweight tags are meant for private or temporary object labels.

From [the `gh release create` documentation](https://cli.github.com/manual/gh_release_create):

> To create a release from an annotated git tag, first create one locally with git, push the tag to GitHub, then run this command.

From [the GitHub REST API documentation](https://docs.github.com/en/rest/git/tags?apiVersion=2022-11-28#about-git-tags):

> The API only supports annotated tag objects, not lightweight tags.

Using the `git` command or the GitHub API to create an annotated tag should work.

However, [I ran into problems when using the `actions/github-script` on duckinator/STAYFOCUSED](https://github.com/duckinator/STAYFOCUSED/actions/runs/12241109636/job/34145462318#step:7:1) (the API call succeeded but the tag was not created).

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the `dispatch-releases` setting handles a missing tag and where it invokes `gh release create`. Check the release automation tests or workflow coverage if available; done means a newly created release tag is annotated rather than lightweight, while preserving existing-tag behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, rust
Domain
ci-cd, release
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.