Gitlab CE - Link to upgrade path from help page

Add a link to the upgrade path tool on Gitlab help page.

  1. // ==UserScript==
  2. // @name Gitlab CE - Link to upgrade path from help page
  3. // @namespace Violentmonkey Scripts
  4. // @match https://gitlab.*/help
  5. // @grant none
  6. // @version 1.0
  7. // @author PotatoesMaster
  8. // @description Add a link to the upgrade path tool on Gitlab help page.
  9. // @run-at document-end
  10. // @license WTFPL
  11. // ==/UserScript==
  12.  
  13. const tagA = document.querySelector('a[href^="https://gitlab.com/gitlab-org/gitlab-foss/-/tags/v"]');
  14. if (tagA) {
  15. const tag = tagA.href.split('tags/v')[1];
  16.  
  17. // addapt the following parameters according to your Gitlab install
  18. const params = new URLSearchParams({
  19. distro: 'docker',
  20. edition: 'ce',
  21. current: tag,
  22. });
  23.  
  24. const upgradeA = document.createElement('a');
  25. upgradeA.href = `https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/?${params}`;
  26. upgradeA.innerText = "-> upgrade path";
  27. tagA.insertAdjacentElement('afterend', upgradeA);
  28. tagA.insertAdjacentText('afterend', ' ');
  29. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址