Skip to content

Commit

Permalink
[Fix] Fetch git tag-ref SHA for associated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jtouzy committed Oct 24, 2022
1 parent b7d6d5f commit 3a82bc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions helpers/Git.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ module.exports = class Git {
.getRef(Object.assign({ ref: `tags/${tag}` }, this.repo))
.then(this.responseHandler)
.then(responseData => {
const ref = {
sha: responseData.object.sha
}
// NOTE: This is necessary because the tag-ref SHA can be different from associated commit SHA
return self.octokit
.git
.getTag(Object.assign({ tag_sha: responseData.object.sha }, self.repo))
})
.then(responseData => {
return self.octokit
.git
.getCommit(Object.assign({ commit_sha: ref.sha }, self.repo))
.getCommit(Object.assign({ commit_sha: responseData.data.object.sha }, self.repo))
})
.then(this.responseHandler)
.then(responseData => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pictarine/release-note-now",
"version": "1.0.7",
"version": "1.0.8",
"description": "Automatic release note generator for GitHub projects",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 3a82bc4

Please sign in to comment.