Describe the bug
If the environment variable http_proxy or HTTP_PROXY is set, the specified proxy is used even if the target host is set in a no_proxy or NO_PROXY environment variable.
To Reproduce
Steps to reproduce the behavior:
- Use the following GitHub workflow:
name: 'My Workflow'
on:
push:
branches:
- main
jobs:
my_build:
name: 'My Build'
steps:
- name: 'Make Runner Environment Available to Job Steps'
run: |
echo "http_proxy=http://proxy.example.com:3128/" >> $GITHUB_ENV
echo "https_proxy=http://proxy.example.com:3128/" >> $GITHUB_ENV
echo "no_proxy=localhost,ecr.aws" >> $GITHUB_ENV
echo "HTTP_PROXY=http://proxy.example.com:3128/" >> $GITHUB_ENV
echo "HTTPS_PROXY=http://proxy.example.com:3128/" >> $GITHUB_ENV
echo "NO_PROXY=localhost,ecr.aws" >> $GITHUB_ENV
- name: 'Prepare Docker Image'
run: |
# build steps which require a working proxy configuration
- name: 'Login to ECR'
uses: aws-actions/amazon-ecr-login@v2
- Ensure that the proxy blocks requests to
ecr.aws (because you wouldn't want to transmit the image through the internet, if the action runner and the proxy are already sitting in AWS)
Expected behavior
The ECR login is successful, the proxy is not contacted because of the no_proxy entry.
Observed behaviour
The ECR login fails due to a "403 Forbidden" response sent by the proxy. The ECR login request can be observed in the proxy logs
Additional information
The bug can be worked around by nuking the proxy configuration before the 'Login to ECR' step.
Environment
- Enterprise account on github.com
- GitHub Action runner in AWS CodeBuild without direct access to the internet
Describe the bug
If the environment variable
http_proxyorHTTP_PROXYis set, the specified proxy is used even if the target host is set in ano_proxyorNO_PROXYenvironment variable.To Reproduce
Steps to reproduce the behavior:
ecr.aws(because you wouldn't want to transmit the image through the internet, if the action runner and the proxy are already sitting in AWS)Expected behavior
The ECR login is successful, the proxy is not contacted because of the no_proxy entry.
Observed behaviour
The ECR login fails due to a "403 Forbidden" response sent by the proxy. The ECR login request can be observed in the proxy logs
Additional information
The bug can be worked around by nuking the proxy configuration before the 'Login to ECR' step.
Environment