-
Notifications
You must be signed in to change notification settings - Fork 139
fix: allow proxy to be false and fallback an empty string #356
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
Conversation
Hey @gr2m, Thanks for taking you time to answer and I agree, however I haven't found a way to do that. Unless you mean changing the verify method to check if proxy is a valid url? I'll try to illustrate my issue more clearly using a GitHub Workflow. name: Basic-Workflow # Runs inside the corporate network
jobs:
build:
runs-on: corporate-runner # Specialized with certificates and HTTP_PROXY env needed for external resources
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run release # GitHub Enterprise hosted inside the same corporate network
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HTTP_PROXY: "" # Attempt to disable inherited proxy settings, but this is invalid for semantic-release/github
# .... Above is a simplified workflow, but at you might guess developers can't really control what HTTP_PROXY the parent runner has set (created by corporate). Set is also the NO_PROXY env, that includes the GitHub Enterprise address, but semantic-release/github doesn't seem to take this into account either. However, using NO_PROXY would add unnecessary complexity as semantic-release/github only accesses a single domain (GitHub API). Does this make more sense? |
@gr2m good morning! I have added two tests, do you feel these cover the changes in the PR? Regards Erik Hughes |
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.
Thanks!
🎉 This PR is included in version 7.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Good work on the library!
I found an issue relating to our enterprise solution, where both our GitHub Actions workflows and our GitHub Enterprise service is on a private network behind a proxy. The
HTTP_PROXY
variable is set for all external connections, but of course we don't want this between resources on the private network as it will fail. Unfortunately I don't get much info from the pipeline:But I suspect after looking the code on lines resolve-config.js L22 and get-client.js L36-L40 that this is the culprit. Proxy cannot be disabled by setting
false
as it will fallback toprocess.env.HTTP_PROXY
, nor canprocess.env.HTTP_PROXY
be "unset" to empty string''
as this fails verify:This pull-request is a simple change that should allow proxy to be set to
false
andprocess.env.http_proxy || process.env.HTTP_PROXY
to be set to empty string.