File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,14 @@ export async function publish(args) {
234234 writeFileSync ( packageJsonPath , _originalPackageJson , 'utf-8' ) ;
235235
236236 if ( args . createGitTag ) {
237- const cmd = `git tag -a ${ packageJson . version } -m "Published ${ packageJson . version } "` ;
237+
238+ let cmd = `git tag -a ${ packageJson . version } -m "Published ${ packageJson . version } "` ;
239+
240+ // set username and email for git
241+ const gitUserName = process . env . GIT_USER_NAME || 'Needle Npm Publish' ;
242+ const gitUserEmail = process . env . GIT_USER_EMAIL || 'hi+git@needle.tools' ;
243+ cmd = `git config user.name "${ gitUserName } " && git config user.email "${ gitUserEmail } " && ${ cmd } ` ;
244+
238245 logger . info ( `Creating git tag with command: ${ cmd } ` ) ;
239246 const res = tryExecSync ( cmd , {
240247 cwd : packageDirectory ,
@@ -243,7 +250,7 @@ export async function publish(args) {
243250 if ( ! res . success ) {
244251 logger . error ( `❌ Failed to create git tag: ${ res . error } ` ) ;
245252 if ( webhook ) {
246- await sendMessageToWebhook ( webhook , `❌ **Failed to create git tag** \`${ packageJson . version } \`: ${ res . error } ` ) ;
253+ await sendMessageToWebhook ( webhook , `❌ **Failed to create git tag** \`${ packageJson . version } \`:\n\`\`\`\n ${ res . error } \n\`\`\` ` ) ;
247254 }
248255 }
249256 }
You can’t perform that action at this time.
0 commit comments