Skip to content

Commit

Permalink
v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Jul 13, 2020
1 parent dc82371 commit e4e25f0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1783,12 +1783,37 @@ exports.checkout = checkout;
async function createTag(name, annotation) {
let tagArgs = ['tag', name];
if (annotation.length) {
// If we're pushing an annotation, `user.name` and `user.email` must be configured.
await ensureUserIsConfigured();
tagArgs.push('-m', annotation);
}
await execa_1.default('git', tagArgs);
await execa_1.default('git', ['push', '--tags']);
}
exports.createTag = createTag;
async function ensureUserIsConfigured() {
if (!(await hasConfig('user.name'))) {
await setConfig('user.name', 'github-actions');
}
if (!(await hasConfig('user.email'))) {
await setConfig('user.email', '[email protected]');
}
}
exports.ensureUserIsConfigured = ensureUserIsConfigured;
async function hasConfig(name) {
try {
await execa_1.default('git', ['config', name]);
return true;
}
catch (_a) {
return false;
}
}
exports.hasConfig = hasConfig;
async function setConfig(name, value) {
await execa_1.default('git', ['config', name, value]);
}
exports.setConfig = setConfig;


/***/ }),
Expand Down

0 comments on commit e4e25f0

Please sign in to comment.