Simple CLI tool to create/delete labels with GitHub Labels API
MIT License
Currently working on making this scripts into a CLI tool
Simple CLI tool to create/delete labels with GitHub Labels API.
https://user-images.githubusercontent.com/474225/130368605-b5c6410f-53f6-4ef0-b321-8950edeebf7d.mov
https://docs.github.com/en/rest/reference/issues#labels
label data format
// label format
{
"id": 3218144327,
"node_id": "MDU6TGFiZWwzMjE4MTQ0MzI3",
"url": "https://api.github.com/repos/koji/frontend-tools/labels/wontfix",
"name": "wontfix",
"color": "ffffff",
"default": true,
"description": "This will not be worked on"
}
You can generate a token here.
If you want to create/delete a single label, you need to type the followings.
In terms of multiple labels, this script is using label.js
to define name, color and description. The format is very simple.
If you want to put your own labels, you will need to modify label.js
file.
module.exports = Object.freeze([
{
name: "Type: Bug Fix",
color: "FF8A65",
description: "Fix features that are not working",
},
{
name: "Type: Enhancement",
color: "64B5F7",
description: "Add new features",
},
clone this repo and run app.js
$ git clone https://github.com/koji/github-label-manager.git
$ cd github-label-manager
# use yarn
$ yarn # install packages
$ yarn build # compile typescript
$ yarn start # run index.js
# use pnpm
$ pnpm install
$ pnpm run build
$ pnpm start
# use npm
$ npm install
$ npm run build
$ npm start
# or use ts-node
$ npx ts-node src/index.ts # this might be slow
After execute the command, you will need to type some information.
create a label
)delete a label
)create labels
is based on labels
in src/constant.ts
https://github.com/koji/github-label-manager/blob/main/src/constant.ts#L59-L208
{
name: 'Type: Bug Fix',
color: 'FF8A65',
description: 'Fix features that are not working',
},
{
name: 'Type: Enhancement',
color: '64B5F7',
description: 'Add new features',
},
https://user-images.githubusercontent.com/474225/130368605-b5c6410f-53f6-4ef0-b321-8950edeebf7d.mov
https://levelup.gitconnected.com/create-github-labels-from-terminal-158d4868fab https://seantrane.com/posts/logical-colorful-github-labels-18230/