GitHub Members
Manage GitHub members who belong to an organization.
Installation
Add this line to your Gemfile
:
gem 'github_members', require: false
Usage
Run bundle exec github_members --help
:
Usage: github_members [options] <org>
-g, --github-token GITHUB_TOKEN A GitHub access token. The `GITHUB_TOKEN` environment variable
is also available.
-m, --markdown-file [FILE] A Markdown file path. Default: `members.md`
-y, --yaml-file [FILE] A YAML file path. Default: `members.yml`
-f, --fields [FIELDS] A comma-separated list of a member additional fields
-h, --help Show help
-v, --version Show version
Examples:
# By default
github_members <org>
# Set a token
GITHUB_TOKEN=*** github_members <org>
github_members <org> -g ***
# Specify files
github_members <org> -m README.md -y company_members.yml
# Add fields
github_members <org> -f slack,note
You can use also the github-members
command instead of github_members
.
Prepare GitHub access token
By default, only public members of a specified organization is fetched.
Perhaps, you may need to generate an access token to fetch all members.
Generate YAML file including members
Fetched organization members are saved in a YAML file. You can add any attributes for a member.
Insert members table into Markdown file
Prepare the begin/end tags in your Markdown file like this:
<!-- GITHUB_MEMBERS:BEGIN -->
<!-- GITHUB_MEMBERS:END -->
When running github_members
, a table of a specified organization members is inserted into the markdown file:
<!-- GITHUB_MEMBERS:BEGIN -->
{inserted_table}
<!-- GITHUB_MEMBERS:END -->
Releasing
- Update
GithubMembers::VERSION
and commit the updated file. - Run workflow on Actions.