Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trustmaster/gh-label-replace
Find & replace labels in GitHub Pull Requests
https://github.com/trustmaster/gh-label-replace
Last synced: 23 days ago
JSON representation
Find & replace labels in GitHub Pull Requests
- Host: GitHub
- URL: https://github.com/trustmaster/gh-label-replace
- Owner: trustmaster
- License: apache-2.0
- Created: 2023-08-09T17:04:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-09T20:37:27.000Z (over 1 year ago)
- Last Synced: 2024-10-15T21:29:43.811Z (2 months ago)
- Language: Python
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub labels replace tool
Find & replace labels in GitHub issues and pull requests
## Configure GitHub token
This tool requires a GitHub token to be set in `GH_TOKEN` environment variable. You can generate a token in your GitHub account settings:
1. Go to [Github settings -> Developer settings](https://github.com/settings/apps)
2. Click [Personal access tokens -> Tokens (classic)](https://github.com/settings/tokens)
3. Click "Generate new token"
4. Create a token with `repo` permissions (or `public_repo` if you're only going to use it with public repositories)
5. Copy the token and set it in `GH_TOKEN` environment variable, or pass it as a command line parameter (see example below)## Usage
```bash
$ python3 gh-label-replace.py [params]
```Parameters:
- `-s` `--start-date` - start date in YYYY-MM-DD format
- `-o` `--overwrite` - overwrite all existing labels completely
- `-d` `--dry-run` - do not actually change anything, just print what would be done
- `owner` - GitHub repository owner/organization
- `repo` - GitHub repository name
- `old_labels` - comma-separated list of old labels
- `new_labels` - comma-separated list of new labelsExample:
```bash
$ GH_TOKEN='exampleToken' python3 gh-label-replace.py --start-date=2020-01-01 trustmaster gh-labels-replace "bug,enhancement" "bug,feature"
```