From a21e3f6eb3eecece7c3a5dcca4315e2ac9847906 Mon Sep 17 00:00:00 2001 From: Michel Zehnder Date: Wed, 11 Dec 2024 09:35:39 +0100 Subject: [PATCH] Fix git build info --- scripts/git_build_info.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/git_build_info.js b/scripts/git_build_info.js index c041865ab64..e60e9099e02 100644 --- a/scripts/git_build_info.js +++ b/scripts/git_build_info.js @@ -33,6 +33,13 @@ const getReleaseName = (commitHash, branch, tag) => { exports.getGitBuildInfo = () => { // all git commands are wrapped in a try block so the build can still succeed outside of a git repo. try { + try { + // set safe.directory to avoid errors + evaluate('git config --global --add safe.directory /external'); + } catch (e) { + console.log('Failed to set safe.directory', e); + } + const commitHash = process.env.GITHUB_SHA ? process.env.GITHUB_SHA : evaluate('git show-ref -s HEAD'); let tag = ''; try {