Skip to content
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

New way for importing labels into new projects #3

Open
oanalavinia opened this issue Apr 10, 2024 · 0 comments
Open

New way for importing labels into new projects #3

oanalavinia opened this issue Apr 10, 2024 · 0 comments

Comments

@oanalavinia
Copy link

This is taken from https://gist.github.com/dysfunc/fc722e865a6a960a2d9c5ecf43f5a963 and it's a little fragile, as it depends on the pages classes

This means that instead of using git-labelmaker what you can do is:

  1. Go to the labels of your project and clean the ones that are not needed, if there are any
  2. Click on New label
  3. Open the Developer console
  4. Paste the following snippet and hit enter
const labels = [
  {
    "name": "Priority: Blocker",
    "color": "#e99695"
  },
  {
    "name": "Priority: Critical",
    "color": "#f9d0c4"
  },
  {
    "name": "Priority: Major",
    "color": "#fef2c0"
  },
  {
    "name": "Priority: Minor",
    "color": "#c5def5"
  },
  {
    "name": "Priority: Trivial",
    "color": "#c2e0c6"
  },
  {
    "name": "Status: Cannot Reproduce",
    "color": "#dddddd"
  },
  {
    "name": "Status: Duplicate",
    "color": "#cccccc"
  },
  {
    "name": "Status: Invalid",
    "color": "#eeeeee"
  },
  {
    "name": "Status: Won't Fix",
    "color": "#ffffff"
  },
  {
    "name": "Type: Bug",
    "color": "#b60205"
  },
  {
    "name": "Type: Improvement",
    "color": "#1d76db"
  },
  {
    "name": "Type: New Feature",
    "color": "#0e8a16"
  },
  {
    "name": "Type: Task",
    "color": "#fbca04"
  }
]

const name = document.getElementById('label-name-');
const description = document.getElementById('label-description-');
const color = document.getElementById('label-color-');
const submit = document.querySelector('.js-label-form .btn.btn-primary');

labels.forEach((label) => addNewLabel(label));

function addNewLabel (label) {
  name.value = label.name;
  description.value = label.description;
  color.value = label.color;
  submit.removeAttribute('disabled');
  submit.click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant