@@ -62,9 +62,9 @@ func main() {
62
62
Value : serpent .BoolOf (& r .debug ),
63
63
},
64
64
{
65
- Flag : "gh -token" ,
65
+ Flag : "github -token" ,
66
66
Description : "GitHub personal access token." ,
67
- Env : "GH_TOKEN " ,
67
+ Env : "GITHUB_TOKEN " ,
68
68
Value : serpent .StringOf (& r .ghToken ),
69
69
},
70
70
{
@@ -245,7 +245,7 @@ func (r *releaseCommand) promoteVersionToStable(ctx context.Context, inv *serpen
245
245
updatedNewStable .Prerelease = github .Bool (false )
246
246
updatedNewStable .Draft = github .Bool (false )
247
247
if ! r .dryRun {
248
- _ , _ , err = client .Repositories .EditRelease (ctx , owner , repo , newStable .GetID (), newStable )
248
+ _ , _ , err = client .Repositories .EditRelease (ctx , owner , repo , newStable .GetID (), updatedNewStable )
249
249
if err != nil {
250
250
return xerrors .Errorf ("edit release failed: %w" , err )
251
251
}
@@ -268,6 +268,10 @@ func cloneRelease(r *github.RepositoryRelease) *github.RepositoryRelease {
268
268
//
269
269
// > ## Stable (since April 23, 2024)
270
270
func addStableSince (date time.Time , body string ) string {
271
+ // Protect against adding twice.
272
+ if strings .Contains (body , "> ## Stable (since" ) {
273
+ return body
274
+ }
271
275
return fmt .Sprintf ("> ## Stable (since %s)\n \n " , date .Format ("January 02, 2006" )) + body
272
276
}
273
277
0 commit comments