GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: remove custom proxy handling by parkerbxyz · Pull Request #143 · actions/create-github-app-token

Conversation

@parkerbxyz

@parkerbxyz parkerbxyz commented Jun 13, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Undici has added native support for proxy handling, so it is no longer necessary for us to have our own custom proxy handling.

Reverts #102 and resolves #134.

Depends on nodejs/node#43187.

Resources

  • Session Proposal: Node.js embed Undici openjs-foundation/summit#443
  • https://hackmd.io/bKQO0mhRR_K30bUKXZVKoQ#Nodejs-embed-Undici
  • Support HTTP_PROXY and NO_PROXY env var nodejs/undici#1650
  • http: support HTTP[S]_PROXY environment variables in fetch nodejs/node#57165

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@parkerbxyz
fix: remove custom proxy handling
ae98c18
Undici has added native support for proxy handling, so it is no longer necessary for us to implement our own custom proxy handling.
@parkerbxyz parkerbxyz self-assigned this Jun 13, 2024
@parkerbxyz parkerbxyz linked an issue Jun 13, 2024 that may be closed by this pull request
Remove custom proxy functionality #134
Closed
@parkerbxyz @gr2m
fix: use unidici fetch
98eac26
@gr2m
gr2m force-pushed the 134-remove-custom-proxy-functionality branch from 47d08ea to 98eac26 Compare June 13, 2024 23:11
@parkerbxyz

parkerbxyz commented Jun 13, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

👋 @dmitrijrub @mikakesan Since you helped us test proxy functionality (#99) when we added support for it in #102, would you be willing to help us test this branch (134-remove-custom-proxy-functionality) to ensure you're still able to use this action with a proxy? 🙏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parkerbxyz
Update code comment
fa33f86
@gr2m gr2m self-assigned this Jun 14, 2024
@dmitrijrub

dmitrijrub commented Jun 14, 2024

Copy link
Copy Markdown

hi @parkerbxyz, what are the changes? should I just use uses: actions/create-github-app-token@134-remove-custom-proxy-functionality ?

gr2m reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parkerbxyz

parkerbxyz commented Jun 14, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

should I just use uses: actions/create-github-app-token@134-remove-custom-proxy-functionality ?

Yes, exactly! 🙂

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dmitrijrub

dmitrijrub commented Jun 17, 2024 •
edited by gr2m
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

hmmm, looks like its failing

Run actions/create-github-app-token@134-remove-custom-proxy-functionality
owner and repositories not set, creating token for the current repository ("dt-arc")
Failed to create token for "dt-arc" (attempt 1): Connect Timeout Error
Failed to create token for "dt-arc" (attempt 2): Connect Timeout Error
Failed to create token for "dt-arc" (attempt 3): Connect Timeout Error
Failed to create token for "dt-arc" (attempt 4): Connect Timeout Error
RequestError [HttpError]: Connect Timeout Error
    at /home/runner/_work/_actions/actions/create-github-app-token/134-remove-custom-proxy-functionality/dist/main.cjs:3[7](https://github.com/company-company/dt-arc/actions/runs/9512488741/job/26317660736#step:10:8)097:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async hook4 (/home/runner/_work/_actions/actions/create-github-app-token/134-remove-custom-proxy-functionality/dist/main.cjs:39469:1[8](https://github.com/org-company/dt-arc/actions/runs/9512488741/job/26317660736#step:10:9))
    at async getTokenFromRepository (/home/runner/_work/_actions/actions/create-github-app-token/134-remove-custom-proxy-functionality/dist/main.cjs:3[9](https://github.com/telia-company/dt-arc/actions/runs/9512488741/job/26317660736#step:10:10)783:20)
    at async RetryOperation._fn (/home/runner/_work/_actions/actions/create-github-app-token/134-remove-custom-proxy-functionality/dist/main.cjs:39660:24) {
  status: 500,
  request: {
    method: 'GET',
    url: xxxx
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'actions/create-github-app-token',
      authorization: 'bearer [REDACTED]'
    },
    request: {
      fetch: [AsyncFunction: fetch],
      hook: [Function: bound hook4] AsyncFunction
    }
  },
  response: undefined,
  attemptNumber: 4,
  retriesLeft: 0
}
Error: Connect Timeout Error
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parkerbxyz

parkerbxyz commented Jul 29, 2024

Copy link
Copy Markdown
Contributor Author

Noting this in case it is helpful later: nodejs/undici#1650 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

parkerbxyz added 4 commits September 3, 2024 16:15
@parkerbxyz
fix: implement EnvHttpProxyAgent
5cb4b2f
`EnvHttpProxyAgent` automatically reads the proxy configuration from the environment variables.
@parkerbxyz
Merge branch 'main' into pr/143
28dfb1e
@parkerbxyz
Merge branch 'main' into 134-remove-custom-proxy-functionality
19e441f
@parkerbxyz
Update node version for undici proxy support
1f00388
@parkerbxyz
parkerbxyz force-pushed the 134-remove-custom-proxy-functionality branch from bbbe985 to 1f00388 Compare September 4, 2024 00:18
parkerbxyz added 4 commits September 3, 2024 17:21
@parkerbxyz
Don't warn if using a node version greater than 20
6aa1ac7
@parkerbxyz
Remove EnvHttpProxyAgent implementation
073d254
Proxy support should be automatic
@parkerbxyz
Update package-lock.json
adf089d
@parkerbxyz
Update dist files
4e61ab3
@parkerbxyz

parkerbxyz commented Sep 4, 2024

Copy link
Copy Markdown
Contributor Author

hmmm, looks like its failing

Thank you so much for testing that, @dmitrijrub! I've made some changes in hopes of fixing the failure you encountered. Would you mind testing again and letting us know how it goes, please? 🙏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gr2m
gr2m reviewed Sep 4, 2024
View reviewed changes
Comment thread lib/request.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

parkerbxyz added 4 commits September 6, 2024 13:33
@parkerbxyz
Merge branch 'main' into pr/143
ed89981
@parkerbxyz
Re-implement EnvHttpProxyAgent as local agent
02b34af
@parkerbxyz
Use native fetch
ff0675e
@parkerbxyz
Update dist files
7a505dc
gr2m
gr2m reviewed Sep 7, 2024
View reviewed changes
Comment thread lib/request.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@parkerbxyz

parkerbxyz commented Oct 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Tests are currently failing due to our current use of the global dispatcher in our tests and local dispatcher in the fetch method. The problem can be reproduced with the following example:

import { EnvHttpProxyAgent, MockAgent, setGlobalDispatcher } from "undici";

const mockAgent = new MockAgent();
mockAgent.disableNetConnect();
setGlobalDispatcher(mockAgent);
const mockPool = mockAgent.get("https://example.test");

mockPool
  .intercept({
    path: `/`,
    method: "GET",
  })
  .reply(200);

await fetch("https://example.test", {
  // Comment out the following line to see the test succeed
  dispatcher: new EnvHttpProxyAgent(),
});

console.log("OK");

The global dispatcher is not being used when a local dispatcher is set. We need to verify if this is a feature or a bug.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gr2m gr2m mentioned this pull request Oct 7, 2024
Support custom permissions #3
Closed
@parkerbxyz

parkerbxyz commented Nov 1, 2024

Copy link
Copy Markdown
Contributor Author

Deno appears to have native proxy support: https://docs.deno.com/runtime/reference/env_variables/#special-environment-variables

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gr2m

gr2m commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

Deno appears to have native proxy support

I'm down for using Deno instead of Node.js, as long as we still generate the built files with all dependencies and execute that code instead of loading dependencies dynamically at run time.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@peter-evans

peter-evans commented Nov 4, 2024

Copy link
Copy Markdown
Contributor

I just received a really helpful PR here: peter-evans/create-pull-request#3475

And that lead me to realise that proxy support can be simplified to this: peter-evans/create-pull-request#3483

It passes the proxy support tests I have, so looks good.

Just thought I would mention this in case it helps here.

parkerbxyz and gr2m reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gr2m

gr2m commented Dec 19, 2024

Copy link
Copy Markdown
Contributor

Thank you @peter-evans! It looks like you use node-fetch-native as a dependency which depends on node-fetch, which is a huge dependency. We try to keep this action slim, so I'd like to avoid that.

We are interested in your test setup though and couldn't quite figure it out. Can you give us some pointers how you test the env-based proxy handling?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@peter-evans

peter-evans commented Dec 20, 2024

Copy link
Copy Markdown
Contributor

It looks like you use node-fetch-native as a dependency which depends on node-fetch, which is a huge dependency. We try to keep this action slim, so I'd like to avoid that.

I see. Well I'm interested to see what solution you end up with here then.

We are interested in your test setup though and couldn't quite figure it out. Can you give us some pointers how you test the env-based proxy handling?

I created a small docker image to launch a forward proxy based on glider. In the test, I start the forward proxy and then configure the firewall on the actions runner. The firewall settings deny outgoing, except through the proxy. So it makes sure that the action is definitely using the proxy when it's configured.

parkerbxyz and gr2m reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parkerbxyz parkerbxyz added this to the v2 milestone Mar 20, 2025
@parkerbxyz parkerbxyz removed this from the v2 milestone Apr 3, 2025
@parkerbxyz

parkerbxyz commented May 2, 2025

Copy link
Copy Markdown
Contributor Author

It looks like Node.js v24 is going to include proxy support:

  • http: support HTTP[S]_PROXY environment variables in fetch nodejs/node#57165
  • 2025-05-06, Version 24.0.0 (Current) nodejs/node#57609
gr2m reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parkerbxyz
Merge branch 'main' into 134-remove-custom-proxy-functionality
b4b4145
@parkerbxyz
parkerbxyz changed the base branch from main to beta August 15, 2025 20:12
parkerbxyz added 4 commits August 15, 2025 13:20
@parkerbxyz
Merge branch 'beta' into 134-remove-custom-proxy-functionality
f83a95a
@parkerbxyz
Remove undici from dependencies
90332d2
The undici package has been removed from the dependencies in package.json and package-lock.json, likely because it is no longer needed in the project.
@parkerbxyz
npm update
fb95ef3
@parkerbxyz
Restore undici as dev dependency
957c582
@parkerbxyz parkerbxyz added this to the v3 milestone Aug 15, 2025
@parkerbxyz
parkerbxyz marked this pull request as ready for review August 22, 2025 19:14
@parkerbxyz
parkerbxyz requested a review from a team as a code owner August 22, 2025 19:14
gr2m
gr2m approved these changes Aug 22, 2025
View reviewed changes
@parkerbxyz
parkerbxyz merged commit cda91bf into beta Aug 22, 2025
@parkerbxyz
parkerbxyz deleted the 134-remove-custom-proxy-functionality branch August 22, 2025 19:16
create-app-token-action-releaser Bot pushed a commit that referenced this pull request Aug 22, 2025
@semantic-release-bot
build(release): 3.0.0-beta.2 [skip ci]
bf559f8
# [3.0.0-beta.2](v3.0.0-beta.1...v3.0.0-beta.2) (2025-08-22)

### Bug Fixes

* remove custom proxy handling ([#143](#143)) ([cda91bf](cda91bf)), closes [#134](#134)
@create-app-token-action-releaser

create-app-token-action-releaser Bot commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.0-beta.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@create-app-token-action-releaser create-app-token-action-releaser Bot added the released on @beta label Aug 22, 2025
@gr2m

gr2m commented Aug 22, 2025 •
edited by parkerbxyz
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Unfortunately, even with Node 24, it's not working out of the box. Now NODE_USE_ENV_PROXY needs to be set to 1 to enable the automated proxy behavior. Setting process.env.NODE_USE_ENV_PROXY='1' in the code does not work.

We see two ways to support the proxy behavior

  1. We ask users to set

       env:
         NODE_USE_ENV_PROXY: 1
  2. We spawn a subprocess in which we can set NODE_USE_ENV_PROXY=1 on startup which makes it work, but it feels quite hacky

    import { spawn } from "child_process";
    
    run();
    
    async function run() {
      if (
        !process.env.NODE_USE_ENV_PROXY &&
        (process.env.HTTP_PROXY || process.env.HTTPS_PROXY)
      ) {
        // spawn itself with NODE_USE_ENV_PROXY=1
        const child = spawn(process.execPath, process.argv.slice(1), {
          env: { ...process.env, NODE_USE_ENV_PROXY: "1" },
          stdio: "inherit",
        });
        child.on("exit", (code) => process.exit(code));
        return;
      }
    
      const response = await fetch("https://example.com");
      console.log(await response.text());
    }
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

parkerbxyz added a commit that referenced this pull request Mar 14, 2026
@parkerbxyz
fix: remove custom proxy handling (#143)
b0a8768
Undici has added native support for proxy handling, so it is no longer necessary for us to have our own custom proxy handling.

Reverts #102 and resolves #134.

(cherry picked from commit cda91bf)
parkerbxyz added a commit that referenced this pull request Mar 14, 2026
@parkerbxyz
fix: remove custom proxy handling (#143)
dce0ab0
Undici has added native support for proxy handling, so it is no longer necessary for us to have our own custom proxy handling.

Reverts #102 and resolves #134.

(cherry picked from commit cda91bf)
create-app-token-action-releaser Bot pushed a commit that referenced this pull request Mar 14, 2026
@semantic-release-bot
build(release): 3.0.0 [skip ci]
f8d387b
# [3.0.0](v2.2.2...v3.0.0) (2026-03-14)

* feat!: node 24 support ([#275](#275)) ([2e564a0](2e564a0))
* fix!: require `NODE_USE_ENV_PROXY` for proxy support ([#342](#342)) ([4451bcb](4451bcb))

### Bug Fixes

* remove custom proxy handling ([#143](#143)) ([dce0ab0](dce0ab0))

### BREAKING CHANGES

* Custom proxy handling has been removed. If you use HTTP_PROXY or HTTPS_PROXY, you must now also set NODE_USE_ENV_PROXY=1 on the action step.
* Requires [Actions Runner v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1) or later if you are using a self-hosted runner.
@create-app-token-action-releaser create-app-token-action-releaser Bot mentioned this pull request May 8, 2026
chore(main): release create-github-app-token 4.0.0 #368
Closed
@YumNumm YumNumm mentioned this pull request May 11, 2026
[Improve]: actions/create-github-app-token を v1.8.1 から v3.1.1 にアップデートする ymm-oss/flutter-mobile-project-template#629
Closed
3 tasks
@github-actions github-actions Bot mentioned this pull request May 15, 2026
chore(ci)(deps): bump actions/create-github-app-token from 2.2.2 to 3.2.0 CopilotKit/CopilotKit#4854
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@bruce-c-liu bruce-c-liu bruce-c-liu left review comments
@gr2m gr2m gr2m approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gr2m gr2m

@parkerbxyz parkerbxyz

Labels

released on @beta

Projects

None yet

Milestone

v3

Development

Successfully merging this pull request may close these issues.

Remove custom proxy functionality

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@parkerbxyz @dmitrijrub @gr2m @peter-evans @bruce-c-liu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.