chore(bot): Allow org members to use bump comments (#6942)

This commit is contained in:
Donny/강동윤 2023-02-14 13:47:41 +09:00 committed by GitHub
parent 8c5a53d0d5
commit 0324d5a78b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions

2
bindings/Cargo.lock generated
View File

@ -168,6 +168,7 @@ dependencies = [
"serde",
"serde_json",
"swc_core",
"swc_node_base",
"tracing",
"tracing-chrome",
"tracing-futures",
@ -2648,6 +2649,7 @@ dependencies = [
"swc_ecma_loader",
"swc_ecma_transforms_base",
"swc_ecma_visit",
"swc_node_base",
"swc_node_bundler",
"swc_nodejs_common",
"swc_plugin_proxy",

View File

@ -67,3 +67,4 @@ swc_core = { version = "0.59.26", features = [
"base_node",
"base_concurrent",
] }
swc_node_base = "0.5.8"

View File

@ -4,6 +4,8 @@
#[macro_use]
extern crate napi_derive;
extern crate swc_node_base;
use std::{env, panic::set_hook, sync::Arc};
use backtrace::Backtrace;

View File

@ -3,7 +3,6 @@ import YAML from "yaml";
const owner = "swc-project";
const repo = "swc";
const maintainer = "kdy1";
export interface Action {
crate: string;
@ -17,8 +16,14 @@ export async function parsePrComments(prNumber: number): Promise<Action[]> {
pull_number: prNumber,
});
const maintainers = await octokit.orgs.listPublicMembers({ org: owner });
return comments.data
.filter((c) => c.user && c.user.login === maintainer)
.filter(
(c) =>
c.user &&
maintainers.data.find((m) => m.login === c.user?.login)
)
.map((c) => {
const idx = c.body.indexOf("swc-bump:");
if (idx === -1) {