If anyone would ancounter the same problem, here is the solution:
In $GITHUB_REF env variable is reference to the release version in format “refs/tags/<tag>”. You can remove the prefix and pass the version to publish command:
run: yarn publish --new-version ${GITHUB_REF#"refs/tags/"}
It will publish the new version, but still ends with error. It is because it tries to also create a commit, but git needs your name and email to do it.
Exit code: 128
Command: git
Arguments: commit -m v2.3.16
Directory: /home/runner/work/pentest-tool-lite/pentest-tool-lite
Output:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident name (for <id>) not allowed
You can either set the user email and name before the command or you can add --no-git-tag-version parameter for yarn publish command. The final publish command then looks like this:
run: yarn publish --new-version ${GITHUB_REF#"refs/tags/"} --no-git-tag-version