Skip to content

Commit

Permalink
make sure to tag the current local sha we are building from
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinmombay committed Jan 26, 2016
1 parent 064b4cb commit addc7d1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build-system/tasks/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand All @@ -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) {
Expand Down

0 comments on commit addc7d1

Please sign in to comment.