Add make_latest property to the GH release POST request during publish#1157
Add make_latest property to the GH release POST request during publish#1157pfarnach wants to merge 3 commits intosemantic-release:masterfrom
make_latest property to the GH release POST request during publish#1157Conversation
There was a problem hiding this comment.
thanks for restarting the effort and conversation around this one, @pfarnach. i think this does get us most of the way there, but we'll need to find a more dynamic approach that considers cases where the stable release branch is not named main
| @@ -0,0 +1,3 @@ | |||
| export default function isLatestRelease({ type, main }) { | |||
| return type === "release" && main ? "true" : "false"; | |||
There was a problem hiding this comment.
There was a problem hiding this comment.
Hi @travi thanks for looking at my PR!
I'm having trouble finding explicit docs about the branch object (the closest thing I could find is here) so I'm going off my very cursory understanding of the source code. It seems like main in this context is a boolean (rather than a string representing the branch name) that's set here, based on the index of the branch that's passed into the config. In any case, that also doesn't seem very reliable unless there's something ensuring the main/master/whatever branch is the first element there.
Would it be enough to just check the type value and remove the main check? From what I can tell, the other possible values are maintenance and prerelease but could use a gut-check on that.
This PR implements the requested change from this stalled PR #884
And fixes #817