googleapis / googleapis/release-please

What is the recommended approach to create an annotated tag (instead of a lightweight tag) when merging a PR created by release-please?

Open
#2,034 5 comments 2 reactions 1 assignee Claimed by @chingor13 View on GitHub
priority: p3 type: question
Dominant language
TypeScript
Stars
7.5k
Forks
588
Avg merge
12h 16m
Merged PRs (30d)
7

Description

My team just started using `release-please` (via GitHub Actions workflow utilizing https://github.com/google-github-actions/release-please-action) and we noticed that the first git tag created for our first merged release PR created a **lightweight tag** instead of an **annotated tag**. Our old release process used `standard-version`/`commit-and-tag-version`, which creates annotated tags, and I was hoping to continue that pattern with `release-please`.

When using a lightweight tag, `git describe` does not respect the latest tag (although `git describe --tags` does) and returns something like `v1.81.1-10-gfb8b2220` instead of the expected `v1.82.0`. I'm not sure if this will cause problems downstream, but I thought there might be an easy way to tell `release-please` to create an annotated tag instead.

Is there a recommended way to accomplish this?

I have considered doing something like `git tag -a -f ^0` as a post-processing step in our GitHub Actions workflow, but [I think that might cause problems for generated releases in GitHub](https://stackoverflow.com/questions/5002555/can-a-lightweight-tag-be-converted-to-an-annotated-tag#comment110678542_5002886).

I also briefly looked into the possibility of using a plugin to accomplish this, but it seems like plugins are mostly for working with monorepos (which my team is not using).

If necessary, I don't have a problem opening a PR to add a new configuration option to use annotated tags instead of lightweight tags, but I'm having difficulty finding where in the codebase the lightweight tag is actually created. I also don't want to assume that this necessitates a code change to `release-please` as it may be something easy I am just missing/haven't found yet.

Please advise, and thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.