embark/scripts/coveralls-pr-id.js

13 lines
281 B
JavaScript

/* global process require */
const {execSync} = require('child_process');
let branchName = execSync('git name-rev --name-only HEAD').toString().trim();
let prId = '';
if (branchName.startsWith('remotes/pull')) {
prId = branchName.split('/')[2];
}
process.stdout.write(prId);