Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy options for Axios calls #111

Closed
wants to merge 5 commits into from

Conversation

jeremy-daley-kr
Copy link

For self-hosted runners where proxy is required, accepts an additional action input of proxy which is passed in as string to https-proxy-agent.

@JamesMGreene
Copy link
Contributor

@daleyjem I may explore an approach more similar to your PR actions/configure-pages#63 rather than introducing customized input parameters for this Action. I'll try to get something in place in the next few days.

@daleyjem
Copy link

@daleyjem I may explore an approach more similar to your PR actions/configure-pages#63 rather than introducing customized input parameters for this Action. I'll try to get something in place in the next few days.

Thanks, @JamesMGreene . I started exploring the path of using the @actions/github package for this repo as well, but the API calls this one makes don't have certain things available... particularly the call to retrieve the artifact. The documented octokit.rest.actions.listWorkflowRunArtifacts() doesn't have data available until the workflow completes, whereas this line uses some "internal" API call where the data is immediately available after artifact upload:

const artifactExgUrl = `${this.runTimeUrl}_apis/pipelines/workflows/${this.workflowRun}/artifacts?api-version=6.0-preview`

I also can't find any documentation for the cancel/status endpoints, and the octokit.rest.repos.createPagesDeployment() isn't yet available in the latest @actions/github. Just too many factors of why I went this route instead.

@daleyjem
Copy link

@JamesMGreene Had another thought, if not wanting to use a proxy input, the action could obey the http_proxy/https_proxy (HTTP_PROXY/HTTPS_PROXY) env vars.

@JamesMGreene
Copy link
Contributor

JamesMGreene commented Feb 16, 2023

@daleyjem / @jeremy-daley-kr: All good points. 👍🏻

I'll look into this more today, as well as adding an issue to make sure we get those new API endpoints published to the REST docs now that they're more public (they're still technically "beta"... but a VERY heavily used beta 😊).

@JamesMGreene
Copy link
Contributor

I'm thinking maybe it's time to switch from using axios to using @actions/http-client, which is the layer underneath @actions/github that provides all of the built-in proxy support for Actions things. 🤔

@JamesMGreene
Copy link
Contributor

Opened alternative PR:

Would be much obliged if you could assist with some real-world testing, @jeremy-daley-kr. 🙇🏻

@jeremy-daley-kr
Copy link
Author

Nice! I'll see if I can get a test going from your branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants