fix: allow proxy to be false and fallback an empty string#356
fix: allow proxy to be false and fallback an empty string#356gr2m merged 5 commits intosemantic-release:masterfrom
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 |
|
🎉 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_PROXYvariable 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
falseas it will fallback toprocess.env.HTTP_PROXY, nor canprocess.env.HTTP_PROXYbe "unset" to empty string''as this fails verify:This pull-request is a simple change that should allow proxy to be set to
falseandprocess.env.http_proxy || process.env.HTTP_PROXYto be set to empty string.