diff --git a/Jenkinsfile b/Jenkinsfile index a79daeba55..4f61d45a38 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,8 @@ node('linux && docker') { withDockerContainer(image: 'node:18', args: '-u=root') { stage('Setup') { + // Fix dubious ownership error in Jenkins + sh "git config --global --add safe.directory ${WORKSPACE}" sh 'npm ci --ignore-scripts' } diff --git a/scripts/get-release-artifact-and-commit-sha.mjs b/scripts/get-release-artifact-and-commit-sha.mjs index 40e503e7f6..d3ee94bb7b 100644 --- a/scripts/get-release-artifact-and-commit-sha.mjs +++ b/scripts/get-release-artifact-and-commit-sha.mjs @@ -49,10 +49,15 @@ async function main() { `curl -L ${asset.browser_download_url} --output ${directory}/${asset.name}` ); } + console.log('tag:', tag); // https://stackoverflow.com/a/1862542 - const tagCommit = spawnSync('git', ['rev-list', '-n', '1', tag], { + const gitps = spawnSync('git', ['rev-list', '-n', '1', tag], { encoding: 'utf-8', - }).stdout.trim(); + }); + console.log('stdout:', gitps.stdout); + console.log('stderr:', gitps.stderr); + const tagCommit = gitps.stdout.trim(); + writeFileSync('latest-commit', tagCommit); readdirSync(topLevelDirectory, {withFileTypes: true}).forEach((file) => {