Compare commits

..

15 Commits

Author SHA1 Message Date
Parker Brown ea0d3155e4 refactor: rename internal appId variable to clientId
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-19 23:05:19 -07:00
copilot-swe-agent[bot] 37f42c53d0 feat: add client-id input and deprecate app-id
Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
2026-03-18 20:32:46 +00:00
copilot-swe-agent[bot] 8204e76db8 docs: document client ID support for app-id
Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
2026-03-18 20:13:20 +00:00
copilot-swe-agent[bot] e9da44231a Initial plan 2026-03-18 20:10:08 +00:00
semantic-release-bot f8d387b68d build(release): 3.0.0 [skip ci]
# [3.0.0](https://github.com/actions/create-github-app-token/compare/v2.2.2...v3.0.0) (2026-03-14)

* feat!: node 24 support ([#275](https://github.com/actions/create-github-app-token/issues/275)) ([2e564a0](https://github.com/actions/create-github-app-token/commit/2e564a0bb8e7cc2b907b2401a2afe177882d4325))
* fix!: require `NODE_USE_ENV_PROXY` for proxy support ([#342](https://github.com/actions/create-github-app-token/issues/342)) ([4451bcb](https://github.com/actions/create-github-app-token/commit/4451bcbc139f8124b0bf04f968ea2586b17df458))

### Bug Fixes

* remove custom proxy handling ([#143](https://github.com/actions/create-github-app-token/issues/143)) ([dce0ab0](https://github.com/actions/create-github-app-token/commit/dce0ab05f36f30b22fd14289fd36655c618e4e8e))

### 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.
2026-03-14 00:22:10 +00:00
Parker Brown d2129bd463 style: remove extra blank line in release workflow
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 17:21:42 -07:00
Parker Brown 77b94efc3e build: refresh generated artifacts
Regenerate dist bundles and package-lock.json after replaying the release-v3 changes onto next.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 17:21:42 -07:00
Parker Brown 3ab4c66898 chore: move undici to devDependencies
Remove unused dotenv.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

(cherry picked from commit adb92d10e9c33600f78e8d1670c5f24c078447f8)
2026-03-13 17:21:42 -07:00
Parker Brown 739cf66feb docs: update README action versions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit b87c921a8e196a5881f0387a9685c0fa784ebde0)
2026-03-13 17:21:42 -07:00
Parker Brown db40289976 build(deps): bump actions versions in test.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit e295338c8bf0bfa10348b7311d00869c5c272447)
2026-03-13 17:21:42 -07:00
Parker Brown 496a7ac4eb test: migrate from AVA to Node.js native test runner (#346)
AVA stores snapshots in a binary format (`.snap`), which produces no
meaningful diffs and bloats Git history. This replaces AVA with the
built-in `node:test` module, whose snapshot support generates
human-readable text files that are easy to diff and review in pull
requests.

The migration also replaces `@sinonjs/fake-timers` and `execa` with
Node.js built-ins (`node:test` mock timers and `node:child_process`),
removing three dev dependencies total.

- **`tests/index.js`**: Rewritten to use `node:test` with a custom
snapshot serializer that renders strings with actual newlines. Uses
subtests for labeled `stderr`/`stdout` snapshots, and only snapshots
non-empty output.
- **`tests/main-repo-skew.test.js`**: Replace `@sinonjs/fake-timers`
with `mock.timers.enable()` from `node:test`.
- **`tests/README.md`**: Updated documentation to reflect `node --test`
and the new snapshot file.
- **`package.json`**: Remove `ava`, `@sinonjs/fake-timers`, and `execa`
from devDependencies. Update test script to `c8 --100 node --test
tests/index.js`.
- **`tests/index.js.snapshot`**: New text-based snapshot file replacing
binary `tests/snapshots/index.js.snap`.
- **`tests/snapshots/`**: Deleted.

All 22 test scenarios (66 subtests) pass with 100% code coverage.

Closes #344

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit f863ba5554)
2026-03-13 17:21:42 -07:00
Parker Brown 3870dc3051 Rename end-to-end proxy job in test workflow
(cherry picked from commit c2937b00bd)
2026-03-13 17:21:42 -07:00
Parker Brown 4451bcbc13 fix!: require NODE_USE_ENV_PROXY for proxy support (#342)
BREAKING CHANGE: 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.
2026-03-13 17:21:42 -07:00
Parker Brown dce0ab05f3 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.

(cherry picked from commit cda91bf2b9)
2026-03-13 17:21:42 -07:00
Salman Chishti 2e564a0bb8 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>
(cherry picked from commit 61789386cb)
2026-03-13 17:21:42 -07:00
12 changed files with 122 additions and 55 deletions
+2 -2
View File
@@ -61,8 +61,8 @@ jobs:
# do not run from forks, as forks dont have access to repository secrets
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: 'npm'
+31 -20
View File
@@ -9,9 +9,11 @@ GitHub Action for creating a GitHub App installation access token.
In order to use this action, you need to:
1. [Register new GitHub App](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app).
2. [Store the App's ID or Client ID in your repository environment variables](https://docs.github.com/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows) (example: `APP_ID`).
2. [Store the App's Client ID in your repository environment variables](https://docs.github.com/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows) (example: `APP_CLIENT_ID`).
3. [Store the App's private key in your repository secrets](https://docs.github.com/actions/security-guides/encrypted-secrets?tool=webui#creating-encrypted-secrets-for-a-repository) (example: `PRIVATE_KEY`).
Pass the App's Client ID using the `client-id` input. The legacy `app-id` input remains available for compatibility, but is deprecated.
> [!IMPORTANT]
> An installation access token expires after 1 hour. Please [see this comment](https://github.com/actions/create-github-app-token/issues/121#issuecomment-2043214796) for alternative approaches if you have long-running processes.
@@ -31,7 +33,7 @@ jobs:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- uses: ./actions/staging-tests
with:
@@ -51,15 +53,15 @@ jobs:
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.head_ref }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
- uses: creyD/prettier_action@v4.3
- uses: creyD/prettier_action@v6
with:
github_token: ${{ steps.app-token.outputs.token }}
```
@@ -77,7 +79,7 @@ jobs:
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Get GitHub App User ID
id: get-user-id
@@ -102,7 +104,7 @@ jobs:
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Get GitHub App User ID
id: get-user-id
@@ -138,10 +140,10 @@ jobs:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: peter-evans/create-or-update-comment@v3
- uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
@@ -160,13 +162,13 @@ jobs:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
repo1
repo2
- uses: peter-evans/create-or-update-comment@v3
- uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
@@ -185,10 +187,10 @@ jobs:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: another-owner
- uses: peter-evans/create-or-update-comment@v3
- uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
@@ -210,11 +212,11 @@ jobs:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
permission-issues: write
- uses: peter-evans/create-or-update-comment@v3
- uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
@@ -252,7 +254,7 @@ jobs:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ matrix.owners-and-repos.owner }}
repositories: ${{ join(matrix.owners-and-repos.repos) }}
@@ -281,7 +283,7 @@ jobs:
id: create_token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHES_APP_ID }}
client-id: ${{ vars.GHES_APP_CLIENT_ID }}
private-key: ${{ secrets.GHES_APP_PRIVATE_KEY }}
owner: ${{ vars.GHES_INSTALLATION_ORG }}
github-api-url: ${{ vars.GITHUB_API_URL }}
@@ -310,15 +312,24 @@ If you set `HTTP_PROXY` or `HTTPS_PROXY`, also set `NODE_USE_ENV_PROXY: "1"` on
NO_PROXY: github.example.com
NODE_USE_ENV_PROXY: "1"
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
```
## Inputs
### `client-id`
**Optional:** GitHub App Client ID. This is the recommended input.
### `app-id`
**Required:** GitHub App ID.
**Optional:** GitHub App ID.
> [!WARNING]
> `app-id` is deprecated. Use `client-id` instead.
You must set either `client-id` or `app-id`. If both are set, `client-id` takes precedence.
### `private-key`
@@ -338,7 +349,7 @@ steps:
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.APP_ID }}
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ steps.decode.outputs.private-key }}
```
+5 -1
View File
@@ -5,9 +5,13 @@ branding:
icon: "lock"
color: "gray-dark"
inputs:
client-id:
description: "GitHub App Client ID"
required: false
app-id:
description: "GitHub App ID"
required: true
required: false
deprecationMessage: "Use 'client-id' instead."
private-key:
description: "GitHub App private key"
required: true
+7 -4
View File
@@ -23153,7 +23153,7 @@ async function pRetry(input, options = {}) {
}
// lib/main.js
async function main(appId, privateKey, owner, repositories, permissions, core, createAppAuth2, request2, skipTokenRevoke) {
async function main(clientId, privateKey, owner, repositories, permissions, core, createAppAuth2, request2, skipTokenRevoke) {
let parsedOwner = "";
let parsedRepositoryNames = [];
if (!owner && repositories.length === 0) {
@@ -23188,7 +23188,7 @@ async function main(appId, privateKey, owner, repositories, permissions, core, c
);
}
const auth5 = createAppAuth2({
appId,
appId: clientId,
privateKey,
request: request2
});
@@ -23307,14 +23307,17 @@ if (!process.env.GITHUB_REPOSITORY_OWNER) {
}
async function run() {
ensureNativeProxySupport();
const appId = getInput("app-id");
const clientId = getInput("client-id") || getInput("app-id");
if (!clientId) {
throw new Error("Either 'client-id' or 'app-id' input must be set");
}
const privateKey = getInput("private-key");
const owner = getInput("owner");
const repositories = getInput("repositories").split(/[\n,]+/).map((s) => s.trim()).filter((x) => x !== "");
const skipTokenRevoke = getBooleanInput("skip-token-revoke");
const permissions = getPermissionsFromInputs(process.env);
return main(
appId,
clientId,
privateKey,
owner,
repositories,
+3 -3
View File
@@ -2,7 +2,7 @@ import pRetry from "p-retry";
// @ts-check
/**
* @param {string} appId
* @param {string} clientId
* @param {string} privateKey
* @param {string} owner
* @param {string[]} repositories
@@ -13,7 +13,7 @@ import pRetry from "p-retry";
* @param {boolean} skipTokenRevoke
*/
export async function main(
appId,
clientId,
privateKey,
owner,
repositories,
@@ -70,7 +70,7 @@ export async function main(
}
const auth = createAppAuth({
appId,
appId: clientId,
privateKey,
request,
});
+5 -2
View File
@@ -18,7 +18,10 @@ if (!process.env.GITHUB_REPOSITORY_OWNER) {
async function run() {
ensureNativeProxySupport();
const appId = core.getInput("app-id");
const clientId = core.getInput("client-id") || core.getInput("app-id");
if (!clientId) {
throw new Error("Either 'client-id' or 'app-id' input must be set");
}
const privateKey = core.getInput("private-key");
const owner = core.getInput("owner");
const repositories = core
@@ -32,7 +35,7 @@ async function run() {
const permissions = getPermissionsFromInputs(process.env);
return main(
appId,
clientId,
privateKey,
owner,
repositories,
+5 -18
View File
@@ -1,26 +1,25 @@
{
"name": "create-github-app-token",
"version": "3.0.0-beta.6",
"version": "3.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "create-github-app-token",
"version": "3.0.0-beta.6",
"version": "3.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.0",
"@octokit/auth-app": "^8.2.0",
"@octokit/request": "^10.0.8",
"p-retry": "^7.1.1",
"undici": "^7.24.1"
"p-retry": "^7.1.1"
},
"devDependencies": {
"@octokit/openapi": "^21.0.0",
"c8": "^10.1.3",
"dotenv": "^17.3.1",
"esbuild": "^0.27.3",
"open-cli": "^8.0.0",
"undici": "^7.24.1",
"yaml": "^2.8.2"
},
"engines": {
@@ -1051,19 +1050,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/dotenv": {
"version": "17.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz",
"integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
@@ -1968,6 +1954,7 @@
"version": "7.24.1",
"resolved": "https://registry.npmjs.org/undici/-/undici-7.24.1.tgz",
"integrity": "sha512-5xoBibbmnjlcR3jdqtY2Lnx7WbrD/tHlT01TmvqZUFVc9Q1w4+j5hbnapTqbcXITMH1ovjq/W7BkqBilHiVAaA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=20.18.1"
+4 -4
View File
@@ -2,7 +2,7 @@
"name": "create-github-app-token",
"private": true,
"type": "module",
"version": "3.0.0-beta.6",
"version": "3.0.0",
"description": "GitHub Action for creating a GitHub App Installation Access Token",
"engines": {
"node": ">=24.4.0"
@@ -19,15 +19,14 @@
"@actions/core": "^3.0.0",
"@octokit/auth-app": "^8.2.0",
"@octokit/request": "^10.0.8",
"p-retry": "^7.1.1",
"undici": "^7.24.1"
"p-retry": "^7.1.1"
},
"devDependencies": {
"@octokit/openapi": "^21.0.0",
"c8": "^10.1.3",
"dotenv": "^17.3.1",
"esbuild": "^0.27.3",
"open-cli": "^8.0.0",
"undici": "^7.24.1",
"yaml": "^2.8.2"
},
"release": {
@@ -44,6 +43,7 @@
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/npm",
"semantic-release-plugin-github-breaking-version-tag",
[
"@semantic-release/git",
{
+1 -1
View File
@@ -33,4 +33,4 @@ node --test --test-update-snapshots tests/index.js
We have tests both for the `main.js` and `post.js` scripts.
- If you do not expect an error, take [main-token-permissions-set.test.js](tests/main-token-permissions-set.test.js) as a starting point.
- If your test has an expected error, take [main-missing-app-id.test.js](tests/main-missing-app-id.test.js) as a starting point.
- If your test has an expected error, take [main-missing-client-and-app-id.test.js](tests/main-missing-client-and-app-id.test.js) as a starting point.
+34
View File
@@ -1,3 +1,24 @@
exports[`action-deprecated-inputs.test.js > stdout 1`] = `
app-id — Use 'client-id' instead.
`;
exports[`main-client-id.test.js > stdout 1`] = `
Inputs 'owner' and 'repositories' are not set. Creating token for this repository (actions/create-github-app-token).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=installation-id::123456
::set-output name=app-slug::github-actions
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::save-state name=expiresAt::2016-07-11T22:14:10Z
--- REQUESTS ---
GET /repos/actions/create-github-app-token/installation
POST /app/installations/123456/access_tokens
{"repositories":["create-github-app-token"]}
`;
exports[`main-custom-github-api-url.test.js > stdout 1`] = `
Inputs 'owner' and 'repositories' are set. Creating token for the following repositories:
@@ -17,6 +38,19 @@ POST /api/v3/app/installations/123456/access_tokens
{"repositories":["create-github-app-token"]}
`;
exports[`main-missing-client-and-app-id.test.js > stderr 1`] = `
Error: Either 'client-id' or 'app-id' input must be set
at run (file:///home/runner/work/create-github-app-token/create-github-app-token/main.js:23:11)
at file:///home/runner/work/create-github-app-token/create-github-app-token/main.js:51:16
 at ModuleJob.run (node:internal/modules/esm/module_job:430:25)
 at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)
at async file:///home/runner/work/create-github-app-token/create-github-app-token/tests/main-missing-client-and-app-id.test.js:12:30
`;
exports[`main-missing-client-and-app-id.test.js > stdout 1`] = `
::error::Either 'client-id' or 'app-id' input must be set
`;
exports[`main-missing-owner.test.js > stderr 1`] = `
GITHUB_REPOSITORY_OWNER missing, must be set to '<owner>'
`;
+11
View File
@@ -0,0 +1,11 @@
import { DEFAULT_ENV, test } from "./main.js";
// Verify `main` accepts a GitHub App client ID via the `client-id` input
await test(
() => {},
{
...DEFAULT_ENV,
"INPUT_CLIENT-ID": "Iv1.0123456789abcdef",
"INPUT_APP-ID": "",
}
);
@@ -0,0 +1,14 @@
import { DEFAULT_ENV } from "./main.js";
for (const [key, value] of Object.entries({
...DEFAULT_ENV,
"INPUT_CLIENT-ID": "",
"INPUT_APP-ID": "",
})) {
process.env[key] = value;
}
// Verify `main` exits with an error when neither `client-id` nor `app-id` is set.
const { default: promise } = await import("../main.js");
await promise;
process.exitCode = 0;