build(CODEOWNERS): protect sensitive paths (#965)
This commit ensures that explicit approval from catppuccin/userstyles-staff is required for paths that are responsible for managing the repository.
This commit is contained in:
1 parent
2bb7df4ce7
commit
f97f2cf6bc
2 files changed
+20
-6
No files matched your search
+5
-1
@@ -80,4 +80,8 @@
|
|||||||
/styles/wikipedia @GitMuslim
|
/styles/wikipedia @GitMuslim
|
||||||
/styles/wikiwand @Tnixc
|
/styles/wikiwand @Tnixc
|
||||||
/styles/youtube @isabelroses @uncenter
|
/styles/youtube @isabelroses @uncenter
|
||||||
/styles/nextjs @Dandraghas
|
/styles/nextjs @Dandraghas
|
||||||
|
|
||||||
|
.github/CODEOWNERS @catppuccin/userstyles-staff
|
||||||
|
/scripts/ @catppuccin/userstyles-staff
|
||||||
|
/template/ @catppuccin/userstyles-staff
|
||||||
@@ -52,15 +52,25 @@ await syncIssueLabels(userstylesData.userstyles);
|
|||||||
/**
|
/**
|
||||||
* Keep `.github/CODEOWNERS` in sync with the userstyle metadata.
|
* Keep `.github/CODEOWNERS` in sync with the userstyle metadata.
|
||||||
*/
|
*/
|
||||||
await updateFile(
|
const CODEOWNERS_FILE = ".github/CODEOWNERS";
|
||||||
join(REPO_ROOT, ".github/CODEOWNERS"),
|
const maintainersCodeOwners = () => {
|
||||||
Object.entries(userstylesData.userstyles)
|
return Object.entries(userstylesData.userstyles)
|
||||||
.filter(([_, { "current-maintainers": currentMaintainers }]) => currentMaintainers.length > 0)
|
.filter(([_, { "current-maintainers": currentMaintainers }]) =>
|
||||||
|
currentMaintainers.length > 0
|
||||||
|
)
|
||||||
.map(([slug, { "current-maintainers": currentMaintainers }]) => {
|
.map(([slug, { "current-maintainers": currentMaintainers }]) => {
|
||||||
const codeOwners = currentMaintainers
|
const codeOwners = currentMaintainers
|
||||||
.map((maintainer) => `@${maintainer.url.split("/").pop()}`)
|
.map((maintainer) => `@${maintainer.url.split("/").pop()}`)
|
||||||
.join(" ");
|
.join(" ");
|
||||||
return `/styles/${slug} ${codeOwners}`;
|
return `/styles/${slug} ${codeOwners}`;
|
||||||
})
|
})
|
||||||
.join("\n"),
|
.join("\n");
|
||||||
|
};
|
||||||
|
const userstylesStaffCodeOwners = () => {
|
||||||
|
const paths = [CODEOWNERS_FILE, "/scripts/", "/template/"];
|
||||||
|
return paths.map((path) => `${path} @catppuccin/userstyles-staff`).join("\n");
|
||||||
|
};
|
||||||
|
await updateFile(
|
||||||
|
join(REPO_ROOT, CODEOWNERS_FILE),
|
||||||
|
`${maintainersCodeOwners()}\n\n${userstylesStaffCodeOwners()}`,
|
||||||
);
|
);
|
||||||
Reference in new issue
Block a user