Created
January 14, 2024 21:59
-
-
Save devinschumacher/7386f318cc1ae97252e4f48299ccb530 to your computer and use it in GitHub Desktop.
Bulk transfer Discussions on Github workaround (at least somewhat bulk)
This file contains hidden or 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
| // open each Discussion in a new tab | |
| document.querySelectorAll('a[data-hovercard-type="discussion"]').forEach(link => { | |
| link.setAttribute('target', '_blank'); | |
| link.click(); | |
| }) |
This file contains hidden or 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
| // select the repo you want to transfer it to | |
| let inputId = 'transfer_repository_732347521'; // Swap out <732347521> for the repository num you need | |
| let inputElement = document.getElementById(inputId); | |
| if (inputElement) { | |
| inputElement.click(); | |
| } else { | |
| console.log('Input element not found'); | |
| } | |
| // click transfer discussion | |
| let submitButton = Array.from(document.querySelectorAll('button[type="submit"]')) | |
| .find(btn => btn.textContent.trim() === 'Transfer discussion'); | |
| if (submitButton) { | |
| submitButton.click(); | |
| } else { | |
| console.log('Submit button not found'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment