Created
October 28, 2020 17:27
-
-
Save MrSquaare/ac0403c82589b15d24175932968156ce to your computer and use it in GitHub Desktop.
Import all labels to a GitHub repository
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
let input = prompt("JSON labels:") | |
let labels = JSON.parse(input) | |
let newLabelForm = document.querySelector("form#new_label") | |
let newLabelNameInput = document.querySelector("input#label-name-") | |
let newLabelDescriptionInput = document.querySelector("input#label-description-") | |
let newLabelColorInput = document.querySelector("input#label-color-") | |
let newLabelSubmitButton = newLabelForm.querySelector(`button[type="submit"]`) | |
labels.forEach(label => { | |
newLabelNameInput.value = label.name | |
newLabelDescriptionInput.value = label.description | |
newLabelColorInput.value = label.color | |
newLabelSubmitButton.disabled = false | |
newLabelSubmitButton.click() | |
}) | |
console.log(labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment