action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

Support for Github Enterprise

Open brenley opened this issue 3 years ago • 9 comments

Hello!

Just followed the guide and found that the workflow fails within Github Enterprise (due to firewall and attempt to invoke api.github.com).

Run softprops/action-gh-release@v1
⚠️ Unexpected error fetching GitHub release for tag refs/tags/v0.0.3: HttpError: request to https://api.github.com/repos/amex-eng/test/releases/tags/v0.0.3 failed, reason: getaddrinfo EAI_AGAIN api.github.com
Error: request to https://api.github.com/repos/amex-eng/boop-boop/releases/tags/v0.0.3 failed, reason: getaddrinfo EAI_AGAIN api.github.com

It looks like like this might be addressable through a minor dependency bump:

  • @actions/github: ^2.0.0, => ^2.2.0
    • https://github.com/actions/toolkit/blob/master/packages/github/RELEASES.md#220

brenley avatar Jul 21 '21 17:07 brenley

Thanks for calling this out. I'm looking to do an upgrade of all dependencies soon

softprops avatar Jul 21 '21 17:07 softprops

Did this ever get done? Looking to use this action.

f0rkz avatar Oct 06 '21 02:10 f0rkz

I tried to use this on Enterprise and I'm getting

Error: Failed to upload release asset root-0.1.0-SNAPSHOT.zip. recieved status code 502 Error uploading to /storage/releases/41590/files: 404

This is after it successfully creates a release. Could it be that Enterprise uses a different path to expose release files?

I'm also worried about the lack of protocol in the URL (hostname isn't prefixed with https).

kubukoz avatar Oct 06 '21 13:10 kubukoz

At least the auto release mechanisms are working. You're right, its most likely a different path and actions most likely exposes that path in an environment variable.

f0rkz avatar Oct 06 '21 13:10 f0rkz

From the docs:

Upload a release asset

This endpoint makes use of a Hypermedia relation to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the upload_url returned in the response of the Create a release endpoint to upload a release asset.

kubukoz avatar Oct 06 '21 16:10 kubukoz

Well, we're already using that it seems:

https://github.com/softprops/action-gh-release/blob/a80139913ad69754b738283897e8a1e3362b1a03/src/main.ts#L71-L77

Update: I think the template is expanded wrong - this is what I get "after" the uploadUrl call:

https://<hostname>/api/uploads/repos/<org>/<repo>/releases/41591/assets{?name,label}

kubukoz avatar Oct 06 '21 17:10 kubukoz

I'm having the same issue with GHE as well. Is this something we can fix? I can help test it or try to manage a PR if I can understand where the issue is.

codezninja avatar Jan 18 '22 19:01 codezninja

I'm having the same issue with GHE as well. Is this something we can fix? I can help test it or try to manage a PR if I can understand where the issue is.

Same

goytia54 avatar Jun 10 '22 00:06 goytia54

Same with GHE, 502 followed by 404.

ruckc avatar Jun 18 '22 00:06 ruckc

The action works in our GHES. However we need to always use a user token, even when all permissions are set in the workflow.

The default GITHUB_TOKEN will throw the error @ruckc mentioned when uploading files.

sorekz avatar Sep 28 '22 14:09 sorekz