Compare commits

...

15 Commits

Author SHA1 Message Date
Parker Brown 0fde60e111 Simplify proxy environment setup in request.js
Removed undici proxy agent configuration and related error handling. Now only sets NODE_USE_ENV_PROXY to encourage Node to honor standard proxy environment variables.
2025-08-22 13:50:04 -07:00
Parker Brown 3ffe05f85c Support lowercase proxy environment variables
Adds detection for lowercase proxy environment variables (https_proxy, http_proxy) in addition to their uppercase counterparts when configuring the global dispatcher.
2025-08-22 13:46:06 -07:00
Parker Brown f57ea8787c Move proxy setup to request.js and update entrypoint
Proxy environment setup previously in bootstrap.js is now handled in lib/request.js for better encapsulation. The action entrypoint is updated from dist/bootstrap.cjs to dist/main.cjs, and bootstrap.js is removed. Build script is updated to exclude bootstrap.js.
2025-08-22 13:43:20 -07:00
Parker Brown 00ba6edc66 Switch build output to CommonJS (.cjs) format
Updated build script to output .cjs files instead of .js, and updated action.yml to reference the new .cjs files. Also clarified proxy environment variable handling in bootstrap.js for consistency.
2025-08-22 13:22:02 -07:00
Parker Brown 21c1159e4d Switch build output to ESM format and update entrypoints
Changed the build script to output ES modules instead of CommonJS. Updated action.yml to reference .js files instead of .cjs, and clarified proxy support logic in bootstrap.js.
2025-08-22 13:16:17 -07:00
Parker Brown 6423fe3683 Add bootstrap entry for env-based proxy support
Introduces bootstrap.js to set NODE_USE_ENV_PROXY before loading main.js, ensuring proxy support is enabled unless explicitly opted out. Updates action.yml to use bootstrap as the main entry and modifies build script to bundle bootstrap.js.
2025-08-22 13:10:57 -07:00
Parker Brown 39808af6a2 Move NODE_USE_ENV_PROXY assignment to top of file
Relocated the setting of process.env.NODE_USE_ENV_PROXY to the beginning of main.js for improved clarity and to ensure the environment variable is set before any imports or logic are executed.
2025-08-22 13:05:03 -07:00
Parker Brown fe4ba3360a Set NODE_USE_ENV_PROXY in main.js and update workflow
Moved NODE_USE_ENV_PROXY environment variable assignment from the GitHub Actions workflow to main.js for consistent runtime configuration. This change ensures the variable is always set when the application runs, regardless of workflow environment settings.
2025-08-22 12:31:42 -07:00
Parker Brown 926b8abad2 Set NODE_USE_ENV_PROXY in test workflow
Adds NODE_USE_ENV_PROXY=1 to the test job environment in GitHub Actions to enable proxy usage via environment variable.
2025-08-22 12:29:23 -07:00
Parker Brown d988c9aaad ci(test): set https_proxy env for test workflow
Adds the https_proxy environment variable to the test job in the GitHub Actions workflow to route requests through the specified proxy.
2025-08-22 12:24:32 -07:00
semantic-release-bot bf559f8544 build(release): 3.0.0-beta.2 [skip ci]
# [3.0.0-beta.2](https://github.com/actions/create-github-app-token/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2025-08-22)

### Bug Fixes

* remove custom proxy handling ([#143](https://github.com/actions/create-github-app-token/issues/143)) ([cda91bf](https://github.com/actions/create-github-app-token/commit/cda91bf2b93cf1d3306b458b2a4f7fcd9de9175f)), closes [#134](https://github.com/actions/create-github-app-token/issues/134)
2025-08-22 19:16:51 +00:00
Parker Brown cda91bf2b9 fix: remove custom proxy handling (#143)
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.
2025-08-22 12:16:16 -07:00
Parker Brown 2ae58da528 Disable semantic-release-plugin-github-breaking-version-tag
https://github.com/gr2m/semantic-release-plugin-update-version-in-files/issues/52
2025-08-15 13:03:02 -07:00
semantic-release-bot fb1c7fda2b build(release): 3.0.0-beta.1 [skip ci]
# [3.0.0-beta.1](https://github.com/actions/create-github-app-token/compare/v2.1.1...v3.0.0-beta.1) (2025-08-15)

* feat!: node 24 support ([#275](https://github.com/actions/create-github-app-token/issues/275)) ([6178938](https://github.com/actions/create-github-app-token/commit/61789386cb26150ab580cab449a9ae053bb9fd24))

### BREAKING CHANGES

* 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.
2025-08-15 19:55:36 +00:00
Salman Chishti 61789386cb feat!: node 24 support (#275)
BREAKING CHANGE: 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.

---------

Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
2025-08-15 12:55:04 -07:00
13 changed files with 994 additions and 41638 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
node-version-file: package.json
cache: 'npm'
- run: npm ci
+5 -3
View File
@@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
node-version-file: package.json
cache: 'npm'
- run: npm ci
@@ -38,12 +38,14 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
node-version-file: package.json
cache: 'npm'
- run: npm ci
- run: npm run build
- uses: ./ # Uses the action in the root directory
id: test
env:
https_proxy: https://example.com
with:
app-id: ${{ vars.TEST_APP_ID }}
private-key: ${{ secrets.TEST_APP_PRIVATE_KEY }}
@@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
node-version-file: package.json
cache: 'npm'
- name: Install dependencies
run: npm ci
-1
View File
@@ -1 +0,0 @@
20.9.0
+12 -12
View File
@@ -28,7 +28,7 @@ jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
@@ -47,13 +47,13 @@ jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.head_ref }}
@@ -73,7 +73,7 @@ jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
# required
@@ -98,7 +98,7 @@ jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
# required
@@ -135,7 +135,7 @@ jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
@@ -157,7 +157,7 @@ jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
@@ -182,7 +182,7 @@ jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
@@ -207,7 +207,7 @@ jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
@@ -249,7 +249,7 @@ jobs:
owners-and-repos: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
steps:
- uses: actions/create-github-app-token@v2
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
@@ -279,7 +279,7 @@ jobs:
steps:
- name: Create GitHub App token
id: create_token
uses: actions/create-github-app-token@v2
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHES_APP_ID }}
private-key: ${{ secrets.GHES_APP_PRIVATE_KEY }}
@@ -318,7 +318,7 @@ steps:
echo "private-key=$private_key" >> "$GITHUB_OUTPUT"
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v2
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ steps.decode.outputs.private-key }}
+1 -1
View File
@@ -132,6 +132,6 @@ outputs:
app-slug:
description: "GitHub App slug"
runs:
using: "node20"
using: "node24"
main: "dist/main.cjs"
post: "dist/post.cjs"
+148 -20580
View File
File diff suppressed because one or more lines are too long
+139 -20564
View File
File diff suppressed because one or more lines are too long
+10 -33
View File
@@ -1,41 +1,18 @@
import core from "@actions/core";
import { request } from "@octokit/request";
import { ProxyAgent, fetch as undiciFetch } from "undici";
const baseUrl = core.getInput("github-api-url").replace(/\/$/, "");
// https://docs.github.com/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners
const proxyUrl =
process.env.https_proxy ||
process.env.HTTPS_PROXY ||
process.env.http_proxy ||
process.env.HTTP_PROXY;
/* c8 ignore start */
// Native support for proxies in Undici is under consideration: https://github.com/nodejs/undici/issues/1650
// Until then, we need to use a custom fetch function to add proxy support.
const proxyFetch = (url, options) => {
const urlHost = new URL(url).hostname;
const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").split(
",",
);
if (!noProxy.includes(urlHost)) {
options = {
...options,
dispatcher: new ProxyAgent(String(proxyUrl)),
};
}
return undiciFetch(url, options);
};
/* c8 ignore start -- env knob setup */
// Encourage Node to honor standard *_PROXY vars for core HTTP(S) agents.
if (process.env.NODE_USE_ENV_PROXY == null) {
process.env.NODE_USE_ENV_PROXY = "1";
}
/* c8 ignore stop */
// Get the GitHub API URL from the action input and remove any trailing slash
const baseUrl = core.getInput("github-api-url").replace(/\/$/, "");
// Configure the default settings for GitHub API requests
export default request.defaults({
headers: {
"user-agent": "actions/create-github-app-token",
},
headers: { "user-agent": "actions/create-github-app-token" },
baseUrl,
/* c8 ignore next */
request: proxyUrl ? { fetch: proxyFetch } : {},
});
+1 -2
View File
@@ -1,5 +1,4 @@
// @ts-check
import core from "@actions/core";
import { createAppAuth } from "@octokit/auth-app";
@@ -38,7 +37,7 @@ export default main(
core,
createAppAuth,
request,
skipTokenRevoke,
skipTokenRevoke
).catch((error) => {
/* c8 ignore next 3 */
console.error(error);
+669 -435
View File
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -2,10 +2,13 @@
"name": "create-github-app-token",
"private": true,
"type": "module",
"version": "2.1.1",
"version": "3.0.0-beta.2",
"description": "GitHub Action for creating a GitHub App Installation Access Token",
"engines": {
"node": ">=24.4.0"
},
"scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0 --packages=bundle",
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --packages=bundle",
"test": "c8 --100 ava tests/index.js",
"coverage": "c8 report --reporter html",
"postcoverage": "open-cli coverage/index.html"
@@ -15,8 +18,7 @@
"@actions/core": "^1.11.1",
"@octokit/auth-app": "^7.2.1",
"@octokit/request": "^9.2.2",
"p-retry": "^6.2.1",
"undici": "^7.8.0"
"p-retry": "^6.2.1"
},
"devDependencies": {
"@octokit/openapi": "^19.1.0",
@@ -27,6 +29,7 @@
"esbuild": "^0.25.8",
"execa": "^9.6.0",
"open-cli": "^8.0.0",
"undici": "^7.13.0",
"yaml": "^2.8.1"
},
"release": {
@@ -43,7 +46,6 @@
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/npm",
"semantic-release-plugin-github-breaking-version-tag",
[
"@semantic-release/git",
{
Binary file not shown.