Skip to content

Instantly share code, notes, and snippets.

@qodunpob
Created August 2, 2018 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qodunpob/cdad17a191bd5996c4f61772701d74e9 to your computer and use it in GitHub Desktop.
Save qodunpob/cdad17a191bd5996c4f61772701d74e9 to your computer and use it in GitHub Desktop.
/* message of the last commit in source code repository */
const lastCommitMessage = spawnSync(
'git',
['log', '--oneline', '-1'],
getSpawnOptions(rootDir, 'pipe')
).stdout.toString().trim();
/* commit message in build repository */
const message = buildBranch === 'master' ? version : lastCommitMessage;
/* making commit in builds repository */
spawnSync('git', ['commit', '-m', `”${message}”`], getSpawnOptions(tempDir));
/* creating a tag in builds repository */
spawnSync('git', ['tag', tag], getSpawnOptions(tempDir));
/* pushing changes to the remote repository */
spawnSync('git', ['push', 'origin', buildBranch], getSpawnOptions(tempDir));
spawnSync('git', ['push', '--tags'], getSpawnOptions(tempDir));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment