Created
May 21, 2025 12:25
-
-
Save sheeeng/e9f1ef707dfcd4fc7a0efe3ba61172f1 to your computer and use it in GitHub Desktop.
GitHub Actions - Automatically Expand Summaries / ViolentMonkey / ViolentMonkeyScripts
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
// ==UserScript== | |
// @name GitHub Actions - Automatically Expand Summaries | |
// @namespace ViolentMonkeyScripts | |
// @version 1.0 | |
// @description Automatically clicks all "Load summary" links on GitHub Actions run pages. | |
// @author Leonard Lee | |
// @match https://github.com/*/actions/runs/* | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
function clickLoadSummaryButtons() { | |
const buttons = Array.from(document.querySelectorAll('button')) | |
.filter(btn => btn.textContent.trim().toLowerCase() === 'load summary'); | |
buttons.forEach(btn => { | |
if (!btn.disabled) { | |
btn.click(); | |
} | |
}); | |
} | |
// Run once on load | |
clickLoadSummaryButtons(); | |
// Observe for dynamically loaded content | |
const observer = new MutationObserver(() => { | |
clickLoadSummaryButtons(); | |
}); | |
observer.observe(document.body, { | |
childList: true, | |
subtree: true | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment