-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCreateCodeowners.java
executable file
·33 lines (24 loc) · 1.3 KB
/
CreateCodeowners.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
///usr/bin/env jbang "$0" "$@" ; exit $?
import java.nio.file.Files;
import java.nio.file.Path;
public class CreateCodeowners {
private static final String CONTENTS = """
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# More details are here: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
# The '*' pattern is global owners.
# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:
# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
* @quarkiverse/quarkiverse-{extension.id}
""";
public static void main(String... args) throws Exception {
// Update the release workflow
Path file = Path.of(".github/CODEOWNERS");
if (!Files.exists(file)) {
String repo = args[0].replace("quarkiverse/quarkus-", "");
Files.writeString(file, CONTENTS.replace("{extension.id}", repo));
}
}
}