-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from gsmet/update-body-properly
Make sure we carry the updated body everywhere
- Loading branch information
Showing
9 changed files
with
163 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 68 additions & 51 deletions
119
src/main/java/io/quarkus/bot/release/ReleaseAction.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/io/quarkus/bot/release/util/UpdatedIssueBody.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.quarkus.bot.release.util; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
public class UpdatedIssueBody { | ||
|
||
private String body; | ||
|
||
public UpdatedIssueBody(String body) { | ||
this.body = body; | ||
} | ||
|
||
public String getBody() { | ||
return body; | ||
} | ||
|
||
public boolean contains(String section) { | ||
if (isBlank()) { | ||
return false; | ||
} | ||
|
||
return body.contains(section); | ||
} | ||
|
||
public String append(String append) { | ||
this.body = (this.body != null ? this.body + "\n\n" : "") + append; | ||
return this.body; | ||
} | ||
|
||
public String replace(Pattern pattern, String replacement) { | ||
this.body = pattern.matcher(body).replaceFirst(replacement); | ||
return this.body; | ||
} | ||
|
||
public boolean isBlank() { | ||
return body == null || body.isBlank(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return body; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters