Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

<img alt="Banner" src="https://svg-banners.vercel.app/api?type=rainbow&text1=GitHub%20Labels%20Manager&width=800&height=400" style="text-align: center;">

[中文](https://github.com/DuckDuckStudio/GitHub-Labels-Manager/blob/main/README.md) | [English](https://github.com/DuckDuckStudio/GitHub-Labels-Manager/blob/main/other-languages/en_US/README.md)

## 项目简介
GLM提供了以下几种功能:
- [x] 获取某个仓库的所有标签,并存在指定目录的`labels.json`中
- [x] 清空某个仓库的标签 *(需要有repo权限的token)*
- [x] 依据指定的**json**文件设置某个仓库的标签 *(先清空指定仓库后再设置,需要有repo权限的token)*
- [x] 复制某个仓库的标签到另一个仓库 *(先清空指定仓库后再设置,需要有repo权限的token)*
- [x] 依据指定的 **json** 文件设置某个仓库的标签 *(先清空指定仓库的标签后再设置,需要有repo权限的token)*
- [x] 复制某个仓库的标签到另一个仓库 *(先清空指定仓库的标签后再设置,需要有repo权限的token)*

### 关于图标
目前的图标仅作临时使用,后续如有正式设计将会替换。
Expand Down Expand Up @@ -84,7 +86,8 @@ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
*请注意,在此之后你将无法再次获取这个Token,请妥善保管Token,不要上传到公共仓库中。*

8. 将Token填入配置文件:
将你的Token填入`config.json`中的`token`中。
将你的Token填入`config.json`中的`token`中。
或者运行`glm config --token <YOUR-TOKEN>`。

## 如何获取
请[前往Releases页获取](https://github.com/DuckDuckStudio/GitHub-Labels-Manager/releases)
Expand Down
113 changes: 113 additions & 0 deletions other-languages/en_US/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# GitHub Labels Manager (GLM)

*Enjoy your day and let automation do it for you. :)*

<img alt="Banner" src="https://svg-banners.vercel.app/api?type=rainbow&text1=GitHub%20Labels%20Manager&width=800&height=400" style="text-align: center;">

[中文](https://github.com/DuckDuckStudio/GitHub-Labels-Manager/blob/main/README.md) | [English](https://github.com/DuckDuckStudio/GitHub-Labels-Manager/blob/main/other-languages/en_US/README.md)

## Project profile
GLM provides the following functions:
- [x] Gets all the labels for a repository, stored in `labels.json` of the specified directory
- [x] Empty the label of a repository *(token with repo permission required)*
- [x] Set the label of a repository according to the specified **json** file *(empty the specified repository's labels before setting, requires a token with repo permission)*
- [x] Copy the label of one repository to another repository *(empty the specified repository's labels before setting, requires a token with repo permission)*

### About icon
The current icon is for temporary use only and will be replaced if there is a formal design.

> [!TIP]
> If you would like to design a new icon, you can send your design to <Yzcbs123@163.com>. Thank you for supporting this project!

## Before use
### Python
Make sure you have the Python environment on your device.
Run the following command to check the Python version:

```bash
python --version
```

You might see output like this:

```
C:\Users\user_name>python --version
Python 3.12.0
```

#### Install Required Libraries
After cd into the project directory, run the following command:
```powershell
# Create a virtual environment
python -m venv .venv
# Activate the virtual environment
.venv\Scripts\Activate.ps1
# Install required libraries
pip install -r requirements.txt
```

> [!TIP]
> Programs obtained using winget do not need to set this.

### Token
You need a GitHub Token to run some of the features.

> [!TIP]
> Official document → [Managing your personal access tokens - GitHub Docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#%E5%88%9B%E5%BB%BA-personal-access-token-classic)

Follow these steps to get a GitHub Token:

1. Sign in to GitHub:
Open GitHub and sign in to your account.

2. Navigate to Settings:
Click on your profile icon in the top right corner, then select "**Settings**".

3. Go to Token settings:
In the left sidebar, click on "**Developer settings**".
Then in the left sidebar again, locate and expand "**Personal access tokens**".
Select "**Tokens (classic)**" under "**Personal access tokens**".

4. Generate a new Token:
Click on "**Generate new token**" in the upper right corner.
Choose "**Generate new token (classic)**".

5. Fill in Token details:
Fill in the form as follows:
Note → Name your token.
Expiration → Choose "No expiration" if you want the token to never expire.
Select scopes → Select **repo** for the token's scope.

6. Generate the Token:
Click the green button at the bottom ("Generate token").

7. Copy the generated Token:
*Note: You won't be able to see this Token again, so make sure to store it securely and do not upload it to public repositories.*

8. Insert the Token into your configuration file:
Paste your Token into the `token` field in the `config.json`.
Or run `glm config --token <YOUR-TOKEN>`

## How to get the program
Please [go to the Releases page](https://github.com/DuckDuckStudio/GitHub-Labels-Manager/releases).

### Using winget
Run the following command:
```powershell
winget install DuckStudio.GitHubLabelsManager
```

> [!TIP]
> If the supported version number is *n*, $1.1 \leqslant n \leqslant 1.2$

## How to use
Run the following command for help:
```powershell
glm --help # winget or packaged program
python glm.py --help # source code
```
Get help for subcommands:
```powershell
glm <command> --help # winget or packaged program
python glm.py <command> --help # source code
```