Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Remove users without a team from GitHub #88

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/github/api/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,20 @@ impl GitHubWrite {
Ok(())
}

pub(crate) fn remove_user_from_organization(
&self,
org: &str,
user: &str,
) -> anyhow::Result<()> {
if !self.dry_run {
let method = Method::DELETE;
let url = &format!("/orgs/{org}/members/{user}");
let response = self.client.req(method.clone(), url)?.send()?;
allow_not_found(response, method, url)?;
}
Ok(())
}

/// Create or update a branch protection.
pub(crate) fn upsert_branch_protection(
&self,
Expand Down
Loading