const { execSync } = require('child_process'); try { const commitHash = execSync('git rev-parse --short HEAD').toString().trim(); console.log(commitHash); } catch (error) { console.log('unknown'); }