pascalgn / automerge-action

GitHub action to automatically merge pull requests that are ready
MIT License
840 stars 207 forks source link

Does this work with enterprise github? #180

Open amritb opened 2 years ago

amritb commented 2 years ago

I am no expert on gh-actions - but I see you have this regex /^https:\/\/github.com\/([^/]+)\/([^/]+)\/(pull|tree)\/([^ ]+)$/; at https://github.com/pascalgn/automerge-action/blob/main/lib/api.js#L9.

So is it supposed to work with github enterprise with different URLs?

cberge908 commented 2 years ago

At least it does not work with out GH Enterprise Server installation. So I would assume that it's not working with GHES in general (as the github.com API seems to be hard-coded).

Would be great if there would be an option to specify the used GH instance URL in this action. Alternatively it would make also sense to get this input from the checkout action, there would no need to specify the URL interactively.

pascalgn commented 2 years ago

We're using Octokit, which can be passed a baseUrl in the configuration: https://octokit.github.io/rest.js/v18

I don't have access to GH Enterprise, so feel free to create a PR for this! 👍

mgoodness commented 1 year ago

I'll take a stab at this, but my JS-foo is incredibly weak. Hope you don't mind some hand-holding!

pascalgn commented 8 months ago

I've merged #238 now, but I believe #216 still contains some other necessary changes, especially this part:

-    const url = `https://x-access-token:${token}@github.com/${full_name}.git`;
+    const url = `https://x-access-token:${token}@${hostname}/${full_name}.git`;
laysauchoa commented 7 months ago

Hi, how can I use with GitHub Enterprise? Thank you in advance!