Closed kenn closed 3 months ago
Thanks for reporting. We should fix this. I wonder though whether Sentry itself supports quotes in releases. In any case this should probably not crash the build though.
Small note though: You're assigning a buffer to process.env. SENTRY_RELEASE
which is probably not the best idea 😄 Maybe do .toString()
or decode as utf8
so that it becomes a string.
Thanks for the quick fix!
That was for reporting abbreviation and this was the actual code, for anyone who finds it useful.
// Get the git info
const DATE = execSync(
"git log -1 --date=format:'%Y-%m-%d' --pretty=format:'%ad'",
)
.toString()
.trim()
const MESSAGE = execSync('git log -1 --pretty=%B')
.toString()
.trim()
.split('\n')[0]
.slice(0, 20)
const HASH = execSync('git rev-parse --short HEAD').toString().trim()
process.env.SENTRY_RELEASE = `${DATE} ${MESSAGE} - ${HASH}`
Environment
Latest everything
Steps to Reproduce
process.env.SENTRY_RELEASE = execSync('git log -1 --pretty=%B')
Expected Result
If it's stored in a JSON, double quotes should be escaped appropriately.
Actual Result