Github Workflow 运行日志快速查看

免去一步一步点击查看运行日志

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Github Workflow 运行日志快速查看
// @namespace    http://tampermonkey.net/
// @version      0.2.5
// @description  免去一步一步点击查看运行日志
// @author       You
// @match        https://github.com/*/actions/runs/*
// @match        https://github.com/*/runs/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    var url = window.location.href;
    if (url.indexOf('actions/runs') != -1) {
        document.querySelector(".filter-list > li:nth-child(3) > a").click();
    } else if (url.indexOf('check_suite_focus') != -1) {
        var span = document.querySelectorAll("span");
        for (var i = 0; i < span.length; i++) {
            if (span[i].innerText.indexOf('Cache node_modules') != -1) {
                var run = span[i].closest('details').nextElementSibling.firstElementChild;
                run.click();
                setTimeout(function () {
                    run.scrollIntoView();
                }, 1500);
                break;
            }
        }
    }

})();