Skip to content

Commit f198a77

Browse files
authored
Merge pull request #215 from arturcic/feature/GH-214
Add option to allow updating published release
2 parents a3c1fa3 + 8401894 commit f198a77

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

Source/GitReleaseManager/Configuration/Config.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public Config()
3232
IncludeShaSection = false,
3333
ShaSectionHeading = "SHA256 Hashes of the release artifacts",
3434
ShaSectionLineFormat = "- `{1}\t{0}`",
35+
AllowUpdateToPublishedRelease = false,
3536
};
3637

3738
Export = new ExportConfig

Source/GitReleaseManager/Configuration/CreateConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ public class CreateConfig
3838

3939
[YamlMember(Alias = "sha-section-line-format")]
4040
public string ShaSectionLineFormat { get; set; }
41+
42+
[YamlMember(Alias = "allow-update-to-published")]
43+
public bool AllowUpdateToPublishedRelease { get; set; }
4144
}
4245
}

Source/GitReleaseManager/GitHubProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public async Task<Release> CreateReleaseFromMilestone(string owner, string repos
153153
{
154154
_logger.Warning("A release for milestone {Milestone} already exists, and will be updated", milestone);
155155

156-
if (!release.Draft)
156+
if (!release.Draft && !_configuration.Create.AllowUpdateToPublishedRelease)
157157
{
158158
throw new InvalidOperationException("Release is not in draft state, so not updating.");
159159
}

docs/input/docs/configuration/default-configuration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ create:
2020
include-sha-section: false
2121
sha-section-heading: "SHA256 Hashes of the release artifacts"
2222
sha-section-line-format: "- `{1}\t{0}`"
23+
allow-update-to-published: false
2324
export:
2425
include-created-date-in-title: false
2526
created-date-string-format: ''
@@ -103,6 +104,10 @@ control the look and feel of the generated release notes.
103104
used when creating the SHA256 hash entries in the release notes.
104105
Default is ``- `{1}\t{0}` `` **NOTE:** This configuration option was added
105106
in version 0.9.0 of GitReleaseManager.
107+
- **allow-update-to-published**
108+
- A boolean value which indicates whether or not updates can be applied to
109+
published releases. The default value is false. **NOTE:** This
110+
configuration option was added in version 0.11.0 of GitReleaseManager.
106111

107112
See the [example create configuration section](create-configuration) to see an
108113
example of how a footer can be configured.

0 commit comments

Comments
 (0)