diff --git a/dist/index.js b/dist/index.js
index 798d6b7..03bd6fc 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1157,8 +1157,16 @@ exports.getRepoPath = getRepoPath;
 function getRemoteDetail(remoteUrl) {
     // Parse the protocol and github repository from a URL
     // e.g. HTTPS, peter-evans/create-pull-request
-    const httpsUrlPattern = /^https:\/\/.*@?github.com\/(.+\/.+)$/i;
-    const sshUrlPattern = /^git@github.com:(.+\/.+).git$/i;
+    let githubServerUrl = process.env['GITHUB_SERVER_URL'];
+    if (!githubServerUrl) {
+        githubServerUrl = 'https://github.com';
+    }
+    const githubServerMatch = githubServerUrl.match(/^https?:\/\/(.+)$/i);
+    if (!githubServerMatch) {
+        throw new Error('Could not parse GitHub Server name');
+    }
+    const httpsUrlPattern = new RegExp('^https?://.*@?' + githubServerMatch[1] + '/(.+/.+)$', 'i');
+    const sshUrlPattern = new RegExp('^git@' + githubServerMatch[1] + ':(.+/.+).git$', 'i');
     const httpsMatch = remoteUrl.match(httpsUrlPattern);
     if (httpsMatch) {
         return {
diff --git a/src/utils.ts b/src/utils.ts
index 8b1fde1..eb6aeb7 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -39,8 +39,24 @@ interface RemoteDetail {
 export function getRemoteDetail(remoteUrl: string): RemoteDetail {
   // Parse the protocol and github repository from a URL
   // e.g. HTTPS, peter-evans/create-pull-request
-  const httpsUrlPattern = /^https:\/\/.*@?github.com\/(.+\/.+)$/i
-  const sshUrlPattern = /^git@github.com:(.+\/.+).git$/i
+  let githubServerUrl = process.env['GITHUB_SERVER_URL']
+  if (!githubServerUrl) {
+    githubServerUrl = 'https://github.com'
+  }
+
+  const githubServerMatch = githubServerUrl.match(/^https?:\/\/(.+)$/i)
+  if (!githubServerMatch) {
+    throw new Error('Could not parse GitHub Server name')
+  }
+
+  const httpsUrlPattern = new RegExp(
+    '^https?://.*@?' + githubServerMatch[1] + '/(.+/.+)$',
+    'i'
+  )
+  const sshUrlPattern = new RegExp(
+    '^git@' + githubServerMatch[1] + ':(.+/.+).git$',
+    'i'
+  )
 
   const httpsMatch = remoteUrl.match(httpsUrlPattern)
   if (httpsMatch) {