<commit_before># Find Inactive Organization Members
> a utility to find, and optionally remove, inactive organization members

This utility finds users inactive since a configured date, writes those users to a file `inactive_users.csv`, and optionally removes them from the organization

## Installation

### Clone this repository

```shell
git clone https://github.com/github/platform-samples.git
cd api/ruby/find-inactive-members
```

### Install dependencies

```shell
gem install octokit
```

### Configure Octokit

```shell
export OCTOKIT_API_ENDPOINT="https://github.example.com/api/v3" # Default: "https://api.github.com"
export OCTOKIT_ACCESS_TOKEN=<PASSWORD>
```

## Usage

```shell
ruby find_inactive_members.rb orgName YYYY-MM-DD
```

or, to automatically remove inactive members

```shell
ruby find_inactive_members.rb orgName YYYY-MM-DD purge
```

## How Inactivity is Defined

Members are defined as inactive if:

* They have not committed to the default branch of a repository in the org since the `YYYY-MM-DD`
* They have not opened an issue or PR that has had activity since the `YYYY-MM-DD`
* They have not commented on an issue or PR since the `YYYY-MM-DD`<commit_msg>update the docs to include the flags<commit_after># Find Inactive Organization Members
> a utility to find, and optionally remove, inactive organization members

This utility finds users inactive since a configured date, writes those users to a file `inactive_users.csv`, and optionally removes them from the organization

## Installation

### Clone this repository

```shell
git clone https://github.com/github/platform-samples.git
cd api/ruby/find-inactive-members
```

### Install dependencies

```shell
gem install octokit
```

### Configure Octokit

```shell
export OCTOKIT_API_ENDPOINT="https://github.example.com/api/v3" # Default: "https://api.github.com"
export OCTOKIT_ACCESS_TOKEN=<PASSWORD>
```

## Usage

```shell
ruby find_inactive_members.rb -o orgName -d YYYY-MM-DD
```

or, to automatically remove inactive members

```shell
ruby find_inactive_members.rb -o orgName -d YYYY-MM-DD -p
```

## How Inactivity is Defined

Members are defined as inactive if:

* They have not committed to the default branch of a repository in the org since the `YYYY-MM-DD`
* They have not opened an issue or PR that has had activity since the `YYYY-MM-DD`
* They have not commented on an issue or PR since the `YYYY-MM-DD`
{'fraction_non_alphanumeric': 0.0968412302576891, 'fraction_numerical': 0.0008312551953449709, 'mean_word_length': 4.814009661835748, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '118129', 'n_tokens_mistral': 748, 'n_tokens_neox': 701, 'n_words': 279}