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

cannot set proxy for a workflow #99

Closed
dmitrijrub opened this issue Jan 29, 2024 · 8 comments · Fixed by #102
Closed

cannot set proxy for a workflow #99

dmitrijrub opened this issue Jan 29, 2024 · 8 comments · Fixed by #102

Comments

@dmitrijrub
Copy link

Hi, it seems that this action does not respect the env proxy settings and you cannot set https_proxy for this workflow.
Its prevents running on selfhosted runners
Warning: Unexpected input(s) 'https_proxy', valid inputs are ['app-id', 'app_id', 'private-key', 'private_key', 'owner', 'repositories', 'skip-token-revoke', 'skip_token_revoke', 'github-api-url']

@gr2m
Copy link
Contributor

gr2m commented Jan 29, 2024

I haven't implemented a proxy input for actions myself yet, can you point to actions that have done it for reference? Can you tell if there is a certain conventions that is recommended?

Our action is built on the JavaScript Octokit, proxies are supported like this for Node usage:
https://github.com/octokit/octokit.js?tab=readme-ov-file#proxy-servers-nodejs-only

Pull request welcome by the way 👋🏼

@dmitrijrub
Copy link
Author

I ended up using peter-murray/workflow-application-token-action action with https_proxy:

@mikakesan
Copy link

@gr2m It would be great if you could look at look at adding proxy support, any plans for that? The other action mentioned here looks like a good one to look at.

@gr2m
Copy link
Contributor

gr2m commented Jan 31, 2024

I'm working on this action as time permits, and time is very limited right now. I can always review a pull request if you need it fast 😅

@parkerbxyz
Copy link
Contributor

Preliminary proxy support has been added in #102 (branch 99-proxy). Could somebody please test the action using actions/create-github-app-token@99-proxy on a self hosted runner to verify that it is working as intended? No need to add a new input. The action will get the proxy URL from the environment variables described here.

@parkerbxyz parkerbxyz linked a pull request Feb 1, 2024 that will close this issue
@mikakesan
Copy link

@parkerbxyz Thanks for that! I have tested your branch and it works fine here.

@dmitrijrub
Copy link
Author

I have gave it a try and token generation works! But it gives warning, it would be nice to add https_proxy to expected values and put it in readme.md
Unexpected input(s) 'https_proxy', valid inputs are ['app-id', 'app_id', 'private-key', 'private_key', 'owner', 'repositories', 'skip-token-revoke', 'skip_token_revoke', 'github-api-url']

@parkerbxyz
Copy link
Contributor

I have gave it a try and token generation works! But it gives warning, it would be nice to add https_proxy to expected values and put it in readme.md Unexpected input(s) 'https_proxy', valid inputs are ['app-id', 'app_id', 'private-key', 'private_key', 'owner', 'repositories', 'skip-token-revoke', 'skip_token_revoke', 'github-api-url']

We do not support any proxy-related inputs, which is why you are receiving this warning. If you remove the line with https_proxy from your workflow file and try again, it should work without any additional configuration.

 - uses: actions/create-github-app-token@v1
   id: app-token
   with:
     app-id: ${{ vars.APP_ID }}
     private-key: ${{ secrets.PRIVATE_KEY }}
-    https_proxy: ${{ vars.HTTPS_PROXY }}

We automatically detect and handle proxy configurations using the environment variables described here.

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