From 3d640308953257471ffcf13b7a8e478b0dd0b5aa Mon Sep 17 00:00:00 2001
From: jiriks74 <jiri@stefka.eu>
Date: Tue, 4 Mar 2025 16:13:44 +0100
Subject: [PATCH 1/2] fix: Code formatting

---
 src/create-pull-request.ts |  4 ++--
 src/github-helper.ts       | 35 ++++++++++++++++++++---------------
 2 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/create-pull-request.ts b/src/create-pull-request.ts
index a8971a7..be7b50b 100644
--- a/src/create-pull-request.ts
+++ b/src/create-pull-request.ts
@@ -51,8 +51,8 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
     core.startGroup('Determining the base and head repositories')
     const baseRemote = gitConfigHelper.getGitRemote()
     // Init the GitHub clients
-    const apiUrl = await GitHubHelper.determineApiUrl(baseRemote.hostname);
-    core.info(`Using API base URL: ${apiUrl}`);
+    const apiUrl = await GitHubHelper.determineApiUrl(baseRemote.hostname)
+    core.info(`Using API base URL: ${apiUrl}`)
     const ghBranch = new GitHubHelper(apiUrl, inputs.branchToken)
     const ghPull = new GitHubHelper(apiUrl, inputs.token)
     // Determine the head repository; the target for the pull request branch
diff --git a/src/github-helper.ts b/src/github-helper.ts
index 15efc16..60546dc 100644
--- a/src/github-helper.ts
+++ b/src/github-helper.ts
@@ -46,42 +46,47 @@ export class GitHubHelper {
     if (token) {
       options.auth = `${token}`
     }
-    options.baseUrl = apiUrl;
+    options.baseUrl = apiUrl
     options.throttle = throttleOptions
     this.octokit = new Octokit(options)
   }
 
   static async determineApiUrl(hostname: string): Promise<string> {
     if (hostname === 'github.com') {
-      return "https://api.github.com";
+      return 'https://api.github.com'
     }
 
-    const baseUrl = `https://${hostname}`;
-    const possiblePaths = ['/api/v4/version', '/api/forgejo/v1/version', '/api/v1/version'];
+    const baseUrl = `https://${hostname}`
+    const possiblePaths = [
+      '/api/v4/version',
+      '/api/forgejo/v1/version',
+      '/api/v1/version'
+    ]
 
     for (const path of possiblePaths) {
       try {
-        const url = `${baseUrl}${path}`;
-        const response = await fetch(url, { method: 'GET', redirect: 'manual' }); // GitLab redirects
-                                                                                  // invalid API paths
-                                                                                  // to login prompt
-                                                                                  // which returns 200
+        const url = `${baseUrl}${path}`
+        const response = await fetch(url, {method: 'GET', redirect: 'manual'}) // GitLab redirects
+        // invalid API paths
+        // to login prompt
+        // which returns 200
 
-        const contentType = response.headers.get('Content-Type') || '';
+        const contentType = response.headers.get('Content-Type') || ''
         if (
           (response.ok || [401, 403].includes(response.status)) && // We might get 401, 403
-                                                                   // as we're unauthorised
+          // as we're unauthorised
           contentType.includes('application/json')
         ) {
-          return path.includes('/version') ? url.replace('/version', '') : url;
+          return path.includes('/version') ? url.replace('/version', '') : url
         }
-
       } catch (error) {
-          // Ignore errors and try the next path
+        // Ignore errors and try the next path
       }
     }
 
-    throw new Error(`Unable to determine API base URL for hostname: ${hostname}`);
+    throw new Error(
+      `Unable to determine API base URL for hostname: ${hostname}`
+    )
   }
 
   private parseRepository(repository: string): Repository {

From fcb0baa025427b2d717df70bb3c4520e54d07bd9 Mon Sep 17 00:00:00 2001
From: jiriks74 <jiri@stefka.eu>
Date: Tue, 4 Mar 2025 16:29:26 +0100
Subject: [PATCH 2/2] fix(ci): Docker is missing in small/medium act runners

---
 .github/workflows/ci.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index def6811..3f0e0d7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -24,6 +24,8 @@ jobs:
         with:
           node-version: 20.x
           cache: npm
+      - name: Install Docker
+        run: apt install docker.io
       - run: npm ci
       - run: npm run build
       - run: npm run format-check