-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🏷️💽 distribute labels into packs geared to tackling missions/themes #716
Comments
This comment was marked as resolved.
This comment was marked as resolved.
i see a few good automations here: |
right, they should split up into packs, like the blogpost says:
status: type: priority: /*
This script will export Github labels to an array.
This array can then be imported using the label importer script.
Instructions:
Go to the labels page for the repo you'd like to export from (https://github.com/user/repo/labels)
Paste this script in your console
Press Enter
Copy the resultant array into the importer script. (https://gist.github.com/AHilyard/5babebe06c30a48e07d949053e00bd5c)
*/
function hslToHex(h, s, l) {
l /= 100;
const a = s * Math.min(l, 1 - l) / 100;
const f = n => {
const k = (n + h / 30) % 12;
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
return Math.round(255 * color).toString(16).padStart(2, '0'); // convert to Hex and prefix "0" if needed
};
return `${f(0)}${f(8)}${f(4)}`;
}
var labels = [];
[].slice.call(document.querySelectorAll(".js-label-link"))
.forEach(function(element) {
labels.push({
name: element.getAttribute("data-name"),
description: element.getAttribute("title"),
color: hslToHex(getComputedStyle(element).getPropertyValue("--label-h"),
getComputedStyle(element).getPropertyValue("--label-s"),
getComputedStyle(element).getPropertyValue("--label-l"))
.trim(),
})
});
console.log(JSON.stringify(labels, null, 2)); /*
This script will import Github labels from an array.
Optionally, existing labels can be removed prior to import.
Instructions:
Go to the labels page for the repo you'd like to import to (https://github.com/user/repo/labels)
Run the labels exporter script first, if you haven't. (https://gist.github.com/AHilyard/a5b9376d0326fd658a8064d5569791a4)
Modify this script by pasting your labels in where directed,
and optionally changing the "removeExisting" variable to true.
Press Enter
Done!
*/
function updateLabel(label) {
var flag = false;
[].slice
.call(document.querySelectorAll(".js-labels-list-item"))
.forEach(function (element) {
if (
element.querySelector(".js-label-link").textContent.trim() === label.name
) {
flag = true;
element.querySelector(".js-edit-label").click();
element.querySelector(".js-new-label-name-input").value = label.name;
element.querySelector(".js-new-label-description-input").value = label.description;
element.querySelector(".js-new-label-color-input").value = "#" + label.color;
element.querySelector(".js-edit-label-cancel ~ .btn-primary").click();
}
});
return flag;
}
function addNewLabel(label) {
document.querySelector(".js-new-label-name-input").value = label.name;
document.querySelector(".js-new-label-description-input").value = label.description;
document.querySelector(".js-new-label-color-input").value = "#" + label.color;
document.querySelector(".js-details-target ~ .btn-primary").disabled = false;
document.querySelector(".js-details-target ~ .btn-primary").click();
}
function addLabel(label) {
if (!updateLabel(label))
{
addNewLabel(label);
}
}
// Change this to true to remove all existing labels first.
var removeExisting = false;
// Remove all pre-existing labels.
if (removeExisting)
{
[].slice.call(document.querySelectorAll(".js-delete-label")).forEach(function (element) {
// Remove the confirmation dialogue first.
element.querySelector(".btn-link").removeAttribute("data-confirm");
element.querySelector(".btn-link").click();
});
}
// Paste your labels here
[]
.forEach(function (label) {
addLabel(label);
}); /*
Purpose: Import settings for GitHub Labels.
(c) James Perrin, MIT License, https://www.countrydawgg.com, | @jamesperrin
Importing Instructions:
1. Update the labels JSON object.
2. Open a web browser.
3. Navigate to the desired GitHub repository.
4. Navigate to Issues tab.
5. Navigate to Labels link.
6. Open the web browswer's Developer Tools
7. Navigate to the Console window.
8. Copy and Paste the below code snippets into the Console window.
Please visit the below link to download the export JavaScript script.
github-labels-export.js - https://gist.github.com/jamesperrin/c2bf6d32fbb8142682f6107e561b664d
*/
const labels = [
{ "name": "♿️ Category: Accessibility", "color": "c5def5" },
{ "name": "🗞️ Category: Blog", "color": "c5def5" },
{ "name": "🧫 Category: Boilerplate Generator", "color": "c5def5" },
{ "name": "📝 Category: Content", "color": "c5def5" },
{ "name": "💄 Category: CSS/Styling", "color": "c5def5" },
{ "name": "📖 Category: Documentation", "color": "c5def5" },
{ "name": "🧪 Category: Examples", "color": "c5def5" },
{ "name": "⚙️ Category: Functionality", "color": "c5def5" },
{ "name": "🏗️ Category: Infrastructure/Tooling/Builds/CI", "color": "c5def5" },
{ "name": "🌐 Category: Localization", "color": "c5def5" },
{ "name": "📢 Category: Marketing", "color": "c5def5" },
{ "name": "🎠 Category: Playground", "color": "c5def5" },
{ "name": "🚸 Category: User Experience (UX)", "color": "c5def5" },
{ "name": "🚨 Category: Tests", "color": "c5def5" },
{ "name": "🥚 Good First Issue (GFI)", "color": "c2e0c6" },
{ "name": "🔥 P0: Critical", "color": "e11d21" },
{ "name": "🌖 P1: High", "color": "e06c6b" },
{ "name": "🌗 P2: Medium", "color": "e99695" },
{ "name": "🌘 P3: Low", "color": "f2c0bf" },
{ "name": "⛔ Status: Blocked", "color": "68ddb0" },
{ "name": "🚧 Status: Work In Progress (WIP)", "color": "fbca04" },
{ "name": "🔮 Status: Pending Triage", "color": "d93f0b" },
{ "name": "🐛 Type: Bug", "color": "c3cc7f" },
{ "name": "✨ Type: Feature", "color": "c3cc7f" },
{ "name": "🔧 Type: Maintenance", "color": "fbca04" },
{ "name": "✨ Type: Enhancement", "color": "84b6eb" },
{ "name": "🧠 Type: Question", "color": "cc317c" },
{ "name": "🔔 Type: New", "color": "c3cc7f" },
{ "name": "♻️ Type: Refactor", "color": "c3cc7f" },
{ "name": "⬆️ Type: Update", "color": "c3cc7f" }
];
// Function to update an existing label
function updateLabel(label) {
let flag = false;
[].slice.call(document.querySelectorAll('.labels-list-item')).forEach((element) => {
if (element.querySelector('.label-link').textContent.trim() === label.name) {
flag = true;
element.querySelector('.js-edit-label').click();
element.querySelector('.js-new-label-name-input').value = label.name;
element.querySelector('.js-new-label-description-input').value = label.description;
element.querySelector('.js-new-label-color-input').value = `#${label.color}`;
element.querySelector('.js-edit-label-cancel ~ .btn-primary').click();
}
});
return flag;
}
// Function to add a new label
function addNewLabel(label) {
document.querySelector('.js-new-label-name-input').value = label.name;
document.querySelector('.js-new-label-description-input').value = label.description;
document.querySelector('.js-new-label-color-input').value = `#${label.color}`;
document.querySelector('.js-details-target ~ .btn-primary').disabled = false;
document.querySelector('.js-details-target ~ .btn-primary').click();
}
// Function to update or add a new label
function addLabel(label) {
if (!updateLabel(label)) {
addNewLabel(label);
}
}
labels.map((label) => {
addLabel(label);
}); |
well, it has been determined (over the last several years) that CLAs are no bueno: so, i have just removed those labels looking at what else sticks out / or is missing wow, 2019 was a very different World! here is the thing tho: we have TC39, WHATWG, etc. members that speak those languages even if they may be displaced at the moment, so altho i do not speak or understand many of those languages, having the translation available to them is not a problem to me at all |
okay, i think we should remove all the multilingual labels for now, since this has not really become too much of concern yet (at least) one can see the most up-to-date collection of labels here (wip): something that is currently kinda in disarray is the color-coding (or lack thereof) of our labels (no method to our madness), but perhaps there should be:
|
well, i should create a nice presentation for y'all like this: |
Refs: https://github.blog/2018-02-22-label-improvements-emoji-descriptions-and-more/
we have spiffy labels in some repos now, but they are not evenly distributed; we should prioritize keeping them nice and safe here w/ directions on how to apply them everywhere else:
syncing scripting:
The text was updated successfully, but these errors were encountered: