Error when attempting to do HTTP call URL with Python

Hi!

I’m trying to use github actions to run pytest. I’ve tested it using act, but it fails when I run it on github. One of the things that we’d like to test involves connecting to an endpoint related to an Azure service. It works fine locally, but it hits this error when testing as a Github action:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/flask_httpauth.py", line 164, in decorated
    return f(*args, **kwargs)
  File "/home/runner/work/image-server/image-server/app.py", line 108, in analyse_image
    analysis = get_image_analysis(imagefile)
  File "/home/runner/work/image-server/image-server/azure_cv.py", line 96, in get_image_analysis
    image_analysis['captions'] = get_captions(io.BytesIO(local_image))
  File "/home/runner/work/image-server/image-server/azure_cv.py", line 19, in get_captions
    description_result = computervision_client.describe_image_in_stream(
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/azure/cognitiveservices/vision/computervision/operations/_computer_vision_client_operations.py", line 1040, in describe_image_in_stream
    response = self._client.send(request, stream=False, **operation_config)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/service_client.py", line 336, in send
    pipeline_response = self.config.pipeline.run(request, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/pipeline/__init__.py", line 197, in run
    return first_node.send(pipeline_request, **kwargs)  # type: ignore
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/pipeline/__init__.py", line 150, in send
    response = self.next.send(request, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/pipeline/requests.py", line 72, in send
    return self.next.send(request, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/pipeline/requests.py", line 137, in send
    return self.next.send(request, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/pipeline/__init__.py", line 150, in send
    response = self.next.send(request, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/pipeline/requests.py", line 193, in send
    self.driver.send(request.http_request, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/universal_http/requests.py", line 333, in send
    return super(RequestsHTTPSender, self).send(request, **requests_kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/msrest/universal_http/requests.py", line 139, in send
    response = session.request(
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/requests/adapters.py", line 467, in send
    low_conn.endheaders()
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/http/client.py", line 1251, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/http/client.py", line 1011, in _send_output
    self.send(msg)
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/http/client.py", line 951, in send
    self.connect()
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect
    conn = self._new_conn()
  File "/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f70d1a5a1f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

It’s there a specific to allow github actions to make requests to a third party?

Thanks