This refactoring from #5766 accidentally broke the tag name calculation for the `build-src-tarball.sh` script so this fixes it by copying over the same logic from `build-tarballs.sh`.
This refactoring from #5766 accidentally broke the tag name calculation for the `build-src-tarball.sh` script so this fixes it by copying over the same logic from `build-tarballs.sh`.