-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HTTPS proxy functionality #850
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for your PR @fhopfensperger
Definitely a great addition to the action.
And all node / ts related aspects look good. Just had a few comments on some aspects.
Happy to assist with adjusting any of these.
For working on actions - I love to use GitHub code spaces - started super quick - and then gives me a full set-up Visual Code environment - including debug support.
README.md
Outdated
@@ -178,6 +178,8 @@ jobs: | |||
|
|||
> **Note**: By default not specifying `fromTag` or `toTag` will resolve `toTag` from either the `ref` or alternatively fallback to the latest tag from the git API. `fromTag` is resolved by sorting tags using [semver](https://semver.org/). Check the [configuration](#configuration-specification) for alternatives. | |||
|
|||
> **Note**: If you behind a corporate HTTP proxy you might set the `HTTPS_PROXY` environment variable to the proxy URL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please link to the docs from octokit here - so people can read up on this environment variable.
src/releaseNotesBuilder.ts
Outdated
request: { | ||
agent: new ProxyAgent() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if we only set-up the ProxyAgent()
in case it is configured to be used - can have a look into this.
package.json
Outdated
@@ -38,6 +38,7 @@ | |||
"@octokit/rest": "^19.0.3", | |||
"@types/semver": "^7.3.10", | |||
"moment": "^2.29.4", | |||
"proxy-agent": "^5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that the used dependency is suggested by the octokit
docs - but the latest version has some unpatched issues open - TooTallNate/node-proxy-agent#74
Need to see if there are alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked into it, all search results in this one 🤔 seems that there is really no real alternative than using that package.
GitHub uses it themself for a wrapper package which is meant to handle this for GitHub actions. https://github.com/octokit/action.js#proxy-servers
Had a look into the above noted comments. Seems the As such I'd propose to limit the scope to HTTPS proxies only for now: f7a5ecd Also only setting it up if the specific ENV variable is provided. |
Thanks for looking into it! Honestly, I'm a bit confused now, where did you point the commit to? What should I do :-) We can also leave this PR open until the proxy agent issues are fixed and then come back and merge it? |
The commit was on a new branch, as I can't push to your branch, but instead of just merging - I figured to give you the opportunity to look into it first. Currently it seems there has not been a lot of movement on the dependency recently. At least lowering the scope to only the HTTPS module seems to significantly reduce the code introduced too. |
Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de> - lower proxy functionality to Https for now (the general proxy package adds a ton of dependencies - which are difficult to review) Add octokit documentation Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de> Lint & build & packaged Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>
I merged your changes into my branch, did a rebase, lint, build, packaged and pushed the latest changes to the branch :-) Thank you very much for your review. If there are other things you would like to change, please let me know. I will be happy to make the changes. |
Thank you very much @fhopfensperger - Will check to get it reviewed and in as soon as possible |
The checks failed because of the token not offering the required permissions -> also there was another change required, which I included in the final merge |
It's released as v3.3.0 (haven't yet moved the v3 tag to monitor things first) |
Thank you! |
According to the Octokit documentation it's necessary to add
ProxyAgent
to the request to be able to connect to GitHub using a corporate HTTP proxy.I tested it successfully in our restricted environment using the following snippet
PS: Please bare with me, it's my first PR to a npm/node based project.
Signed-off-by: Florian Hopfensperger florian.hopfensperger@allianz.de