fix: use only hash in semver build metadata

This commit is contained in:
Yarmo Mackenbach 2024-01-30 01:21:13 +01:00
parent 912f3619eb
commit ed4c265dad
No known key found for this signature in database
GPG key ID: C248C28D432560ED

View file

@ -82,19 +82,14 @@ export function encodeZBase32 (data) {
} }
export function getMetaFromReq (req) { export function getMetaFromReq (req) {
let versionDetails = req.app.get('git_branch') let versionDetails = (req.app.get('git_hash'))
? `+${req.app.get('git_branch')}` ? `+${req.app.get('git_hash').substring(0, 10)}`
: ''
versionDetails += (req.app.get('git_branch') && req.app.get('git_hash'))
? `.${req.app.get('git_hash').substring(0, 10)}`
: '' : ''
const semver = `${req.app.get('keyoxide_name')}/${req.app.get('keyoxide_version')}${versionDetails}` const semver = `${req.app.get('keyoxide_name')}/${req.app.get('keyoxide_version')}${versionDetails}`
const sourceUrl = req.app.get('git_hash') const sourceUrl = req.app.get('git_hash')
? `https://codeberg.org/keyoxide/keyoxide-web/src/commit/${req.app.get('git_hash')}` ? `https://codeberg.org/keyoxide/keyoxide-web/src/commit/${req.app.get('git_hash')}`
: req.app.get('git_branch')
? `https://codeberg.org/keyoxide/keyoxide-web/src/branch/${req.app.get('git_branch')}`
: 'https://codeberg.org/keyoxide/keyoxide-web' : 'https://codeberg.org/keyoxide/keyoxide-web'
return { return {