Skip to content

Commit

Permalink
fix: better usage of simple git to assure asynchronous operations (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg authored Jan 22, 2021
1 parent 7450f61 commit e2a6fcf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 6 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6107,13 +6107,12 @@ async function push(token, url, branchName, message, committerUsername, committe

if (core.isDebug()) __webpack_require__(231).enable('simple-git');

return await git
.add('./*')
.addConfig('user.name', committerUsername)
.addConfig('user.email', committerEmail)
.commit(message)
.addRemote('auth', authanticatedUrl(token, url, committerUsername))
.push(['-u', 'auth', branchName]);
await git.add('./*');
await git.addConfig('user.name', committerUsername);
await git.addConfig('user.email', committerEmail);
await git.commit(message);
await git.addRemote('auth', authanticatedUrl(token, url, committerUsername));
await git.push(['-u', 'auth', branchName]);
}


Expand Down
13 changes: 6 additions & 7 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ async function push(token, url, branchName, message, committerUsername, committe

if (core.isDebug()) require('debug').enable('simple-git');

return await git
.add('./*')
.addConfig('user.name', committerUsername)
.addConfig('user.email', committerEmail)
.commit(message)
.addRemote('auth', authanticatedUrl(token, url, committerUsername))
.push(['-u', 'auth', branchName]);
await git.add('./*');
await git.addConfig('user.name', committerUsername);
await git.addConfig('user.email', committerEmail);
await git.commit(message);
await git.addRemote('auth', authanticatedUrl(token, url, committerUsername));
await git.push(['-u', 'auth', branchName]);
}

0 comments on commit e2a6fcf

Please sign in to comment.