wangyoucao577 / assets-uploader

Command line tool to robustly upload Github release assets.
Apache License 2.0
6 stars 5 forks source link

AEP: implement github client for enterprise github domains #38

Open alex60217101990 opened 2 months ago

alex60217101990 commented 2 months ago

I want to use your github action: https://github.com/wangyoucao577/go-release-action but when calling the utility: https://github.com/wangyoucao577/go-release-action/blob/ec68290905b5e90fcab97069f9546af4303dd91a/release.sh #L190 I get an error. After debugging, I found in your code: https://github.com/wangyoucao577/assets-uploader/blob/a87fed080d1dfb2e942f67f8884966e296571dae/cmd/github-assets-uploader/main.go#L66 you only use a regular client, without the ability to use: https://github.com/google/go-github/blob/v17.0.0/github/github.go#L272. Can you please make the utility and github action more universal so that you can redefine api.github.com to the desired one ?

wangyoucao577 commented 2 months ago

Actually the github-assets-uploader tool will use WithEnterpriseURLs when -baseurl is set. see https://github.com/wangyoucao577/assets-uploader/blob/a87fed080d1dfb2e942f67f8884966e296571dae/cmd/github-assets-uploader/main.go#L66-L69

However, the go-release-action doesn't support it yet since I don't have enviornment to test it. Here's some idea that how to enable the feature on go-release-action https://github.com/wangyoucao577/go-release-action/issues/165. It will be helpful if you can test it, PR is welcome once it's ok.

wangyoucao577 commented 1 month ago

@alex60217101990 Would you please have a try with wangyoucao577/go-release-action@feature/baseurl? Since I don't have enterprise environment to test it.