checkout current branch

This commit is contained in:
phips28 2019-10-27 01:52:27 +02:00
parent 2a8b69f3bf
commit ae38bb6a26
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,6 @@ const { execSync } = require('child_process')
Toolkit.run(async tools => {
const pkg = tools.getPackageJSON()
const event = tools.context.payload
// console.log('payload:', event)
const messages = event.commits.map(commit => commit.message + '\n' + commit.body)
@ -29,6 +28,9 @@ Toolkit.run(async tools => {
await tools.runInWorkspace('git', ['config', 'user.name', '"Automated Version Bump"'])
await tools.runInWorkspace('git', ['config', 'user.email', '"gh-action-bump-version@users.noreply.github.com"'])
const currentBranch = /refs\/[a-zA-Z]+\/(.*)/.exec(process.env.GITHUB_REF)
console.log('currentBranch:', currentBranch)
await tools.runInWorkspace('git', ['checkout', currentBranch])
await tools.runInWorkspace('npm',
['version', '--allow-same-version=true', '--git-tag-version=false', current])
console.log('current:', current, '/', 'version:', version)