Skip to content

Commit 6abec3d

Browse files
committed
Remove merge label after merge
1 parent da44414 commit 6abec3d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/main/java/net/neoforged/automation/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static void main(String[] args) throws IOException, NoSuchAlgorithmExcept
6161

6262
var location = Configuration.load(gitHub, startupConfig);
6363

64-
var webhook = setupWebhookHandlers(startupConfig, new WebhookHandler(startupConfig, gitHub), location);
64+
var webhook = setupWebhookHandlers(startupConfig, new WebhookHandler(startupConfig.get("webhookSecret", ""), gitHub), location);
6565

6666
fileHostService = new FileHostService(Path.of("files"), startupConfig);
6767

src/main/java/net/neoforged/automation/webhook/impl/WebhookHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class WebhookHandler implements Handler {
3535

3636
private final Map<GitHubEvent, EventHandler[]> handlers = new IdentityHashMap<>();
3737

38-
public WebhookHandler(StartupConfiguration configuration, GitHub gitHub) {
39-
this.secretToken = configuration.get("webhookSecret", "").getBytes(StandardCharsets.UTF_8);
38+
public WebhookHandler(String secretToken, GitHub gitHub) {
39+
this.secretToken = secretToken.getBytes(StandardCharsets.UTF_8);
4040
this.gitHub = gitHub;
4141
}
4242

src/main/java/net/neoforged/automation/webhook/label/MergeLabelHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ public void onLabelAdded(GitHub gitHub, GHUser actor, GHIssue issue, GHLabel lab
1515

1616
final String title = pr.getTitle() + " (#" + pr.getNumber() + ")";
1717
GitHubAccessor.merge(pr, title, null, method);
18+
issue.removeLabels(label);
1819
}
1920
}

0 commit comments

Comments
 (0)