https://github.com/popomore/github-labels
Add github labels automatically
https://github.com/popomore/github-labels
github github-labels laravel
Last synced: 9 months ago
JSON representation
Add github labels automatically
- Host: GitHub
- URL: https://github.com/popomore/github-labels
- Owner: popomore
- Created: 2014-01-26T17:28:18.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-02-24T20:27:15.000Z (almost 4 years ago)
- Last Synced: 2025-04-09T22:11:43.301Z (9 months ago)
- Topics: github, github-labels, laravel
- Language: JavaScript
- Size: 28.3 KB
- Stars: 178
- Watchers: 7
- Forks: 20
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
Awesome Lists containing this project
README
# Github Labels
Add github labels automatically.
It's very useful that init all your custom labels when create a repo.
---
## Install
```
$ npm install github-labels -g
```
## Usage
```
$ labels -c path/to/conf.json user/repo
```
About config file, see [my conf](https://gist.github.com/popomore/8ef8ad0573c97081da22dca1cc84173e) for example.
```
[
{"name": "bug", "color": "ffffff"},
{"name": "feature", "color": "000000"}
]
```
Your can simplify it that will generate github default color automatically.
```
["bug", "feature"]
```
Force option will delete all existing labels, otherwise will create label when not exist or update label when existing label has different color.
```
$ labels -c path/to/conf.json -f user/repo
```
## GitHub Enterprise configuration
If you're using a GitHub Enterprise instance, you'll need to pass some additional parameters to target your environment
* `host` - The hostname of your GHE instance.
* `pathPrefix` - The path to the API. Frequently for GHE this will be `/api/v3`.
```
$ labels -c path/to/conf.json -h github.myhost.com -p /api/v3 user/repo
```
You can also provide the OAuth token to be used directly via the `--token` parameter.
This is useful when your GHE environment does not allow user/pass login.
```
$ labels -c path/to/conf.json -h github.myhost.com -p /api/v3 -t PERSONAL_TOKEN_123 user/repo
```
### Export from GitHub website
Here is a snippet to be able to export github labels from the labels page of a project
[gist.github.com/MoOx/93c2853fee760f42d97f](https://gist.github.com/MoOx/93c2853fee760f42d97f)
Running this code in your browser console should output your some json ready to be imported.
## License
MIT