From addc7d10efe8a5c8570beed68078f502f145e0a1 Mon Sep 17 00:00:00 2001 From: Erwin Mombay Date: Tue, 26 Jan 2016 12:36:42 -0800 Subject: [PATCH] make sure to tag the current local sha we are building from --- build-system/tasks/changelog.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build-system/tasks/changelog.js b/build-system/tasks/changelog.js index 2281873dd06b..629fc06e8ae3 100644 --- a/build-system/tasks/changelog.js +++ b/build-system/tasks/changelog.js @@ -73,12 +73,14 @@ function getGitMetadata() { if (isDryrun) { return; } - return submitReleaseNotes(argv.version, gitMetadata.changelog); + return getCurrentSha().then( + submitReleaseNotes.bind(null, version, gitMetadata.changelog) + ); }) .catch(errHandler); } -function submitReleaseNotes(version, changelog) { +function submitReleaseNotes(version, changelog, sha) { var name = String(version); var options = { url: 'https://api.github.com/repos/ampproject/amphtml/releases', @@ -90,7 +92,7 @@ function submitReleaseNotes(version, changelog) { json: true, body: { 'tag_name': name, - 'target_commitish': branch, + 'target_commitish': sha, 'name': name, 'body': changelog, 'draft': true, @@ -109,6 +111,10 @@ function submitReleaseNotes(version, changelog) { }); } +function getCurrentSha() { + return gitExec({ args: 'rev-parse HEAD' }); +} + function buildChangelog(gitMetadata, githubMetadata) { var titles = githubMetadata .filter(function(data) {