Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign github tags created by release command #1773

Open
LNSD opened this issue Oct 15, 2024 · 5 comments
Open

Sign github tags created by release command #1773

LNSD opened this issue Oct 15, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@LNSD
Copy link

LNSD commented Oct 15, 2024

Motivations

The creation (and push) of Git tags is automated by the release-plz release command. The newly created tags are not signed, so they appear in the GitHub UI as "unverified":

image

  • Would you like to implement this feature? Yes

Proposed Solution

Currently, there's no GitHub API that supports signing git tags (see this GitHub discussion), despite a REST API exists to create signed/verified commits using the GitHub token.

To sign tags in the CI using git's --sign option, we could use an environment variable (e.g., GPG_SIGNING_KEY) to pass a GPG sub-key ID to the release command. This environment variable can be optional and keep the current behavior if not provided.

Of course, this would require the GPG key to be imported in the action container's GPG keyring using, for instance, the Import GPG action.

@LNSD LNSD added the enhancement New feature or request label Oct 15, 2024
@MarcoIeni
Copy link
Owner

a REST API exists to create signed/verified commits using the GitHub token.

We are already using this, right?
Is this useful to create signed tags, too?

@LNSD
Copy link
Author

LNSD commented Oct 16, 2024

We are already using this, right?
Is this useful to create signed tags, too?

I meant that there is no API to create signed tags. The only way to do this is to use the regular signing mechanism, i.e., GPG, to sign the commits.

@MarcoIeni
Copy link
Owner

I see.

I wonder how release-please sings tags. https://github.com/googleapis/release-please/tags 🤔

@LNSD
Copy link
Author

LNSD commented Oct 16, 2024

I see.

I wonder how release-please sings tags. googleapis/release-please/tags 🤔

I think they are using an external in-house-built service. At least, that is what the .kokoro/ directory files suggests to me.

@MarcoIeni
Copy link
Owner

I see.

Of course, this would require the GPG key to be imported in the action container's GPG keyring using, for instance, the Import GPG action.

Can't this be done by the user before running the release-plz action?
Release-plz can add the -s to the git tag if it detects that a gpg key is configured (I guess if the following is present in the .gitconfig:

[tag]
    gpgSign = true

what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants