<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sonarcloud on akky blog</title>
    <link>http://blog.akky.me/tags/sonarcloud/</link>
    <description>Recent content in Sonarcloud on akky blog</description>
    <generator>Hugo</generator>
    <language>jp-ja</language>
    <lastBuildDate>Mon, 23 Dec 2024 00:00:00 +0000</lastBuildDate>
    <atom:link href="http://blog.akky.me/tags/sonarcloud/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Auto-Login Script for SonarCloud with GitHub Authentication</title>
      <link>http://blog.akky.me/blog/20241223-tampermonkey-sonarcloud-auto-login/</link>
      <pubDate>Mon, 23 Dec 2024 00:00:00 +0000</pubDate>
      <guid>http://blog.akky.me/blog/20241223-tampermonkey-sonarcloud-auto-login/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;&#xA;&lt;p&gt;This Tampermonkey script automatically handles the SonarCloud login process when you encounter authentication errors. It detects error pages and automatically initiates GitHub login, making the authentication process seamless.&lt;/p&gt;&#xA;&lt;h2 id=&#34;script&#34;&gt;Script&lt;/h2&gt;&#xA;&lt;p&gt;Create a new Tampermonkey script and paste the following code:&lt;/p&gt;&#xA;&lt;script src=&#34;https://gist.github.com/akriaueno/4dd997666d4fcfdca2b8ec8c67b5acb6.js&#34;&gt;&lt;/script&gt;&#xA;&#xA;&lt;h2 id=&#34;how-it-works&#34;&gt;How it Works&lt;/h2&gt;&#xA;&lt;p&gt;The script performs the following tasks:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Error Page Detection&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Waits for the error message &amp;ldquo;The requested project does not exist, or you have not authenticated with SonarQube Cloud&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;Automatically clicks the &amp;ldquo;Login&amp;rdquo; button when found&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;&lt;strong&gt;Login Page Handling&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Detects when redirected to the login page&lt;/li&gt;&#xA;&lt;li&gt;Automatically clicks the configured social authentication button (GitHub by default)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;&lt;strong&gt;Utilities&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;waitUntil&lt;/code&gt;: A utility function that waits for specific conditions to be met&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;findAndClick&lt;/code&gt;: Finds and clicks elements using XPath selectors&lt;/li&gt;&#xA;&lt;li&gt;Built-in timeout mechanism to prevent infinite loops&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the Tampermonkey browser extension&lt;/li&gt;&#xA;&lt;li&gt;Create a new script&lt;/li&gt;&#xA;&lt;li&gt;Copy and paste the provided code&lt;/li&gt;&#xA;&lt;li&gt;Save the script&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;&#xA;&lt;p&gt;The script includes two main configurable settings:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
