GitHub Actions Retry Floating Button

Adds a floating button to GitHub Actions run pages to retry all jobs with one click

2025-09-02 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         GitHub Actions Retry Floating Button
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Adds a floating button to GitHub Actions run pages to retry all jobs with one click
// @match        https://github.com/*/actions/runs/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    // Create the button
    const btn = document.createElement('button');
    btn.textContent = 'Retry Failed Jobs';
    btn.style.position = 'fixed';
    btn.style.bottom = '30px';
    btn.style.right = '30px';
    btn.style.padding = '14px 24px';
    btn.style.zIndex = '10000';
    btn.style.background = '#28a745';
    btn.style.color = '#fff';
    btn.style.border = 'none';
    btn.style.borderRadius = '99px';
    btn.style.boxShadow = '0 2px 12px rgba(0,0,0,0.15)';
    btn.style.fontSize = '1.1em';
    btn.style.cursor = 'pointer';
    btn.style.transition = 'background 0.2s';
    btn.addEventListener('mouseenter', () => btn.style.background = '#218838');
    btn.addEventListener('mouseleave', () => btn.style.background = '#28a745');

    // Retry function
    btn.onclick = async () => {
        // Look for all "Re-run jobs" buttons and click them
        const menuButton = Array.from(document.querySelectorAll('button'))
            .filter(btn => /Re-run jobs/i.test(btn.textContent) && btn.offsetParent !== null)[0];

        if (!menuButton) {
            alert('No "Re-run jobs" button found on this page.');
            return;
        }

        menuButton.click();

        const retryButton = Array.from(document.querySelectorAll('button'))
            .filter(btn => /Re-run failed jobs/i.test(btn.textContent))[0];

        if (!retryButton) {
            alert('No "Re-run failed jobs" button found on this page.');
            return;
        }

        retryButton.click();

        const dialogRetryButton = Array.from(document.querySelector('#rerun-dialog-failed').querySelectorAll('button')).filter(btn => /Re-run jobs/i.test(btn.textContent))[0];

        if (!dialogRetryButton) {
            alert('No "Re-run jobs" dialog button found on this page.');
            return;
        }

        dialogRetryButton.click();
    };

    document.body.appendChild(btn);
})();