https://github.com/safwanuddinmairaj/github-users-list-shellscript
This script is designed to list all users who have read access to a specified GitHub repository. It uses the GitHub API to fetch and display collaborators with read permissions for a given repository.
https://github.com/safwanuddinmairaj/github-users-list-shellscript
github linux shell-script ubuntu
Last synced: about 2 months ago
JSON representation
This script is designed to list all users who have read access to a specified GitHub repository. It uses the GitHub API to fetch and display collaborators with read permissions for a given repository.
- Host: GitHub
- URL: https://github.com/safwanuddinmairaj/github-users-list-shellscript
- Owner: SafwanUddinMairaj
- Created: 2024-08-06T20:18:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-07T05:02:11.000Z (almost 2 years ago)
- Last Synced: 2025-02-02T15:35:09.905Z (over 1 year ago)
- Topics: github, linux, shell-script, ubuntu
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## GitHub Repository Access List Script
**Description**
This script, list-users.sh, is designed to list all users who have read access to a specified GitHub repository. It uses the GitHub API to fetch and display collaborators with read permissions for a given repository.
**Usage**
To use this script, you need to have a GitHub personal access token with the necessary permissions to access the repository information. The script takes two arguments: the repository owner's username and the repository name.
**Prerequisites**
- **cURL**: This script uses `curl` to make HTTP requests to the GitHub API.
- **jq**: A lightweight and flexible command-line JSON processor, required to parse JSON responses from the GitHub API.
- **GitHub Personal Access Token**: You need a personal access token with the appropriate scopes to access repository collaborators.
### Installation
Ensure you have `curl` and `jq` installed on your system. You can install them using the following commands:
**For Debian/Ubuntu:**
```bash
sudo apt-get install curl jq
```
**For CentOS:**
```bash
sudo yum install curl jq
```
## Script Usage
1. **Set your GitHub username and personal access token as environment variables**:
```bash
export username="your-github-username"
export token="your-personal-accesstoken"
```
2. **Grant permission according to your need using chmod command**
3. **Run the script** with the repository owner's username and repository name as arguments:
```bash
./list-users.sh
```