Skip to content

Commit

Permalink
style: use an owner
Browse files Browse the repository at this point in the history
  • Loading branch information
baerwang committed Apr 17, 2024
1 parent 80f7fe9 commit 9c94ec8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugin = "github"
token = "ghp_4"
reviews = ["baerwang"]
owners = [{ name = "baerwang", repos = ["pika"] }]
owners = { name = "baerwang", repos = ["pika"] }
orgs = { }
2 changes: 1 addition & 1 deletion src/conf/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct ConfigData {
pub plugin: String,
pub token: String,
pub reviews: Vec<String>,
pub owners: Vec<Owner>,
pub owners: Owner,
pub orgs: HashMap<String, Vec<String>>,
}

Expand Down
8 changes: 3 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ fn main() {
let plugin = config.plugin.as_str();
let reviews: HashMap<String, ()> = config.reviews.iter().map(|key| (key.clone(), ())).collect();

config.owners.iter().for_each(|owner| {
let api = get_api(plugin, owner.name.clone(), reviews.clone());
owner.repos.iter().for_each(|repo| {
_ = api.execute(token, repo.as_str());
})
let api = get_api(plugin, config.owners.name.clone(), reviews.clone());
config.owners.repos.iter().for_each(|repo| {
_ = api.execute(token, repo.as_str());
});

for (org, repos) in &config.orgs {
Expand Down

0 comments on commit 9c94ec8

Please sign in to comment.