aws-actions / configure-aws-credentials

Configure AWS credential environment variables for use in other GitHub Actions.
MIT License
2.49k stars 473 forks source link

HTTP_PROXY environment variable is ignored #1165

Closed Titzi90 closed 1 month ago

Titzi90 commented 1 month ago

Describe the bug

According to your Documentation the action should concider the HTTP_PROXY environment variable:

Additionally this action will always consider the HTTP_PROXY environment variable.

However it seems it does not.

Running the following workflow behind a proxy does not work:

name: Proxy Test
on: workflow_dispatch
jobs:
  test:
    runs-on: self-hosted
    permissions:
      id-token: write   # This is required for requesting the JWT from awsG
      contents: read    # This is required for actions/checkout
    steps:
      - name: set proxy
        run: |
          echo "HTTP_PROXY=http://my-proxy.com" >> $GITHUB_ENV
          echo "HTTPS_PROXY=http://my-proxy.com" >> $GITHUB_ENV
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::1234567890
          aws-region: eu-west-1

while this action where the proxy is explicit set does work:

name: Proxy Test
on: workflow_dispatch
jobs:
  test:
    runs-on: self-hosted
    permissions:
      id-token: write   # This is required for requesting the JWT from awsG
      contents: read    # This is required for actions/checkout
    steps:
      - name: set proxy
        run: |
          echo "HTTP_PROXY=http://my-proxy.com" >> $GITHUB_ENV
          echo "HTTPS_PROXY=http://my-proxy.com" >> $GITHUB_ENV
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::1234567890
          aws-region: eu-west-1
          http-proxy: ${{ env.HTTP_PROXY }}

Regression Issue

Expected Behavior

Example one to work as example two

Current Behavior

Example one fails to connect to aws (time out)

Reproduction Steps

see above

Possible Solution

No response

Additional Information/Context

No response

Titzi90 commented 1 month ago

I tested a few older versions of aws-actions/configure-aws-credentials. It looks like it does work with v2 but stop working in v3:

name: Proxy Test
on: workflow_dispatch
jobs:
  test:
    runs-on: self-hosted
    permissions:
      id-token: write   # This is required for requesting the JWT from awsG
      contents: read    # This is required for actions/checkout
    steps:
      - name: set proxy
        run: |
          echo "HTTP_PROXY=http://my-proxy.com" >> $GITHUB_ENV
          echo "HTTPS_PROXY=http://my-proxy.com" >> $GITHUB_ENV
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v2
        with:
          role-to-assume: arn:aws:iam::1234567890
          aws-region: eu-west-1

runs as expected and gives the following message:

Setting proxy from environment: http://my-proxy.com/
Dboy554 commented 1 month ago

Nice

kellertk commented 1 month ago

Please see #1061. Closing this as a duplicate issue.

github-actions[bot] commented 1 month ago

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one.