Created
July 11, 2020 10:25
-
-
Save Ice3man543/22570d980200c6190859513593a40ad6 to your computer and use it in GitHub Desktop.
Export github labels from https://github.com/<user>/<repo>/issues/labels page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Forked from https://gist.github.com/MoOx/93c2853fee760f42d97f | |
// Only change i did was make it return proper color code | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".js-label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), | |
description: element.getAttribute("title"), | |
// using style.backgroundColor might returns "rgb(...)" | |
color: element.style.backgroundColor | |
.substring( 4, element.style.backgroundColor.length - 1 ) | |
.split( ',' ) | |
.reduce( ( hexValue, rgbValue ) => { | |
return ( | |
hexValue + | |
Number( rgbValue ).toString( 16 ) | |
.padStart( 2, '0' ) | |
); | |
}, '' ), | |
}) | |
}) | |
console.log(JSON.stringify(labels, null, 2)) |
Author
Ice3man543
commented
Jul 11, 2020
•
[
{
"name": "Priority: Critical",
"description": "This should be dealt with ASAP. Not fixing this issue would be a serious error.",
"color": "e11d21"
},
{
"name": "Priority: High",
"description": "After critical issues are fixed, these should be dealt with before any further issues.",
"color": "eb6421"
},
{
"name": "Priority: Low",
"description": "This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix",
"color": "009800"
},
{
"name": "Priority: Medium",
"description": "This issue may be useful, and needs some attention.",
"color": "fbca03"
},
{
"name": "Status: Abandoned",
"description": "This issue is no longer important to the requestor and no one else has shown an interest in it.",
"color": "000000"
},
{
"name": "Status: Accepted",
"description": "It's clear what the subject of the issue is about, and what the resolution should be.",
"color": "009800"
},
{
"name": "Status: Available",
"description": "No one has claimed responsibility for resolving this issue",
"color": "bfe5bf"
},
{
"name": "Status: Blocked",
"description": "There is some issue that needs to be resolved first.",
"color": "e11d21"
},
{
"name": "Status: Completed",
"description": "Nothing further to be done with this issue. Awaiting to be closed.",
"color": "006a74"
},
{
"name": "Status: In Progress",
"description": "This issue is being worked on, and has someone assigned.",
"color": "cccccc"
},
{
"name": "Status: On Hold",
"description": "Similar to blocked, but is assigned to someone",
"color": "e11d21"
},
{
"name": "Status: Review Needed",
"description": "The issue has a PR attached to it which needs to be reviewed",
"color": "fbca03"
},
{
"name": "Status: Revision Needed",
"description": "Submitter of PR needs to revise the PR related to the issue.",
"color": "e11d21"
},
{
"name": "Type: Bug",
"description": "Inconsistencies or issues which will cause an issue or problem for users or implementors.",
"color": "e11d21"
},
{
"name": "Type: Discussion",
"description": "Some ideas need to be planned and disucssed to come to a strategy.",
"color": "5254bf"
},
{
"name": "Type: Enhancement",
"description": "Most issues will probably ask for additions or changes.",
"color": "84b6eb"
},
{
"name": "Type: Maintenance",
"description": "Updating phrasing or wording to make things clearer or removing ambiguity.",
"color": "fbca03"
},
{
"name": "Type: Optimization",
"description": "Increasing the performance/optimization. Not an issue, just something to consider.",
"color": "e7f49f"
},
{
"name": "Type: Question",
"description": "A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.",
"color": "cc327c"
}
]
A good default set of labels.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment