If you, like me, release your projects to the Snap Store using GoReleaser, you might need to eventually update the secret.

It seems to me that the secret expires every year, and this is the time of the year I need to renew mine.

To help future me, this is my recipe on how to do it quickly:

snapcraft export-login /tmp/snap.login
gh secret set SNAPCRAFT_STORE_CREDENTIALS </tmp/snap.login

If you used to use snapcraft login --with, it is not needed anymore! You can simply set the SNAPCRAFT_STORE_CREDENTIALS to authenticate, e.g.:

SNAPCRAFT_STORE_CREDENTIALS=$(cat /tmp/snap.login) snapcraft whoami

Hope this is helpful for you, or future me. 👴