Schneegans / dynamic-badges-action

This action allows you to create badges for your README.md with shields.io which may change with every commit. To do this, this action does not need to push anything to your repository!
https://schneegans.github.io/tutorials/2022/04/18/badges
MIT License
257 stars 37 forks source link

When using selft-hosted runner which set proxy, it will throw erros #13

Closed Zephyr596 closed 1 year ago

Zephyr596 commented 2 years ago

erros:

Run schneegans/dynamic-badges-action@v1.4.0
  with:
    gistID: 7495dccc42118020c12de5a095cfa2a6
    filename: nb-scala-build.json
    label: Time is 2022-08-[26](https://github.com/intel-analytics/BigDL/runs/8030396654?check_suite_focus=true#step:5:29)_05:46:03
    message: success
    color: red
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.342-7/x64
    TIME: 2022-08-26_05:46:03
    JOB-STATUS: success
    COLOR: red
events.js:291
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 140.82.114.5:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (_http_client.js:4[27](https://github.com/intel-analytics/BigDL/runs/8030396654?check_suite_focus=true#step:5:30):9)
    at TLSSocket.emit (events.js:[31](https://github.com/intel-analytics/BigDL/runs/8030396654?check_suite_focus=true#step:5:34)4:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '1[40](https://github.com/intel-analytics/BigDL/runs/8030396654?check_suite_focus=true#step:5:44).82.114.5',
  port: 4[43](https://github.com/intel-analytics/BigDL/runs/8030396654?check_suite_focus=true#step:5:47)
}
Schneegans commented 2 years ago

Hi there! Thanks for the report. However, I see not really a way how we could debug this. The error messages do not tell me much, there seems to be a connection timeout when talking to a server from GitHub. Why? I have no idea. Can your runner access api.github.com?

Zephyr596 commented 2 years ago

Thank you for your reply! This error is caused by self-hosted-runner's proxy. When we use nodejs to send http requests, it can't get self-hosted-runner's proxy, so it throw this error. The global-tunnel-ng module on NPM appears to handle this. Before an http request occurs, I set proxy as follows

globalTunnel.initialize({
  connect: 'neither',
  protocol: 'https:',
  host: 'your proxy host',
  port: 8080 //your proxy port
});

You can refer to my fork repo