mirror of
https://github.com/actions/create-github-app-token.git
synced 2026-12-01 14:55:26 +00:00
chore(main): release 3.2.0 (#370)
🤖 I have created a release *beep* *boop* --- ## [3.2.0](https://github.com/actions/create-github-app-token/compare/v3.1.1...v3.2.0) (2026-05-12) ### Features * add support for enterprise-level GitHub Apps ([#263](https://github.com/actions/create-github-app-token/issues/263)) ([952a2a7](https://github.com/actions/create-github-app-token/commit/952a2a7073df6bfa5f49bc469ec895b6ec1acea4)) * support full repository names in `repositories` input ([#372](https://github.com/actions/create-github-app-token/issues/372)) ([85eb8dd](https://github.com/actions/create-github-app-token/commit/85eb8dd41472213aed25d1a126460e0069138ab6)) ### Bug Fixes * **deps:** bump @actions/core from 3.0.0 to 3.0.1 in the production-dependencies group ([#364](https://github.com/actions/create-github-app-token/issues/364)) ([43e5c34](https://github.com/actions/create-github-app-token/commit/43e5c345bfd4d4f3ecea019ad0042001a09dd857)) * validate private-key input ([#376](https://github.com/actions/create-github-app-token/issues/376)) ([f24bbd8](https://github.com/actions/create-github-app-token/commit/f24bbd89643991c0de27ae823c01791b2c6bafdd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: create-app-token-action-releaser[bot] <135574722+create-app-token-action-releaser[bot]@users.noreply.github.com> Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
This commit is contained in:
1 parent
f24bbd8964
commit
bcd2ba4921
5 files changed
+57
-11
No files matched your search
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "3.1.1"
|
||||
".": "3.2.0"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## [3.2.0](https://github.com/actions/create-github-app-token/compare/v3.1.1...v3.2.0) (2026-05-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for enterprise-level GitHub Apps ([#263](https://github.com/actions/create-github-app-token/issues/263)) ([952a2a7](https://github.com/actions/create-github-app-token/commit/952a2a7073df6bfa5f49bc469ec895b6ec1acea4))
|
||||
* support full repository names in `repositories` input ([#372](https://github.com/actions/create-github-app-token/issues/372)) ([85eb8dd](https://github.com/actions/create-github-app-token/commit/85eb8dd41472213aed25d1a126460e0069138ab6))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** bump @actions/core from 3.0.0 to 3.0.1 in the production-dependencies group ([#364](https://github.com/actions/create-github-app-token/issues/364)) ([43e5c34](https://github.com/actions/create-github-app-token/commit/43e5c345bfd4d4f3ecea019ad0042001a09dd857))
|
||||
* validate private-key input ([#376](https://github.com/actions/create-github-app-token/issues/376)) ([f24bbd8](https://github.com/actions/create-github-app-token/commit/f24bbd89643991c0de27ae823c01791b2c6bafdd))
|
||||
Vendored
+38
-7
@@ -23241,24 +23241,52 @@ function resolveInstallationTarget(enterprise, owner, repositories, core) {
|
||||
);
|
||||
return { type: "owner", owner };
|
||||
}
|
||||
const parsedOwner = owner || String(process.env.GITHUB_REPOSITORY_OWNER);
|
||||
const target = normalizeRepositoryTarget(owner, repositories);
|
||||
if (!owner) {
|
||||
core.info(
|
||||
`No 'owner' input provided. Using default owner '${parsedOwner}' to create token for the following repositories:${repositories.map((repo) => `
|
||||
- ${parsedOwner}/${repo}`).join("")}`
|
||||
`No 'owner' input provided. Using default owner '${target.owner}' to create token for the following repositories:${target.repositories.map((repo) => `
|
||||
- ${target.owner}/${repo}`).join("")}`
|
||||
);
|
||||
} else {
|
||||
core.info(
|
||||
`Inputs 'owner' and 'repositories' are set. Creating token for the following repositories:${repositories.map((repo) => `
|
||||
- ${parsedOwner}/${repo}`).join("")}`
|
||||
`Inputs 'owner' and 'repositories' are set. Creating token for the following repositories:${target.repositories.map((repo) => `
|
||||
- ${target.owner}/${repo}`).join("")}`
|
||||
);
|
||||
}
|
||||
return {
|
||||
type: "repository",
|
||||
owner: parsedOwner,
|
||||
repositories
|
||||
owner: target.owner,
|
||||
repositories: target.repositories
|
||||
};
|
||||
}
|
||||
function normalizeRepositoryTarget(owner, repositories) {
|
||||
const parsedOwner = owner || String(process.env.GITHUB_REPOSITORY_OWNER);
|
||||
const parsedRepositories = repositories.map(parseRepositoryInput);
|
||||
const mismatchedRepository = parsedRepositories.find(
|
||||
(repository) => repository.owner && repository.owner.toLowerCase() !== parsedOwner.toLowerCase()
|
||||
);
|
||||
if (mismatchedRepository) {
|
||||
throw new Error(
|
||||
`Repository '${mismatchedRepository.input}' includes owner '${mismatchedRepository.owner}', which does not match the resolved owner '${parsedOwner}'.`
|
||||
);
|
||||
}
|
||||
return {
|
||||
owner: parsedOwner,
|
||||
repositories: parsedRepositories.map((repository) => repository.name)
|
||||
};
|
||||
}
|
||||
function parseRepositoryInput(input) {
|
||||
const parts = input.split("/");
|
||||
if (parts.length === 1 && parts[0]) {
|
||||
return { input, owner: "", name: parts[0] };
|
||||
}
|
||||
if (parts.length === 2 && parts[0] && parts[1]) {
|
||||
return { input, owner: parts[0], name: parts[1] };
|
||||
}
|
||||
throw new Error(
|
||||
`Invalid repository '${input}'. Expected 'repository' or 'owner/repository'.`
|
||||
);
|
||||
}
|
||||
function getTokenRetryDescription(target) {
|
||||
switch (target.type) {
|
||||
case "enterprise":
|
||||
@@ -23397,6 +23425,9 @@ async function run() {
|
||||
throw new Error("The 'client-id' (or deprecated 'app-id') input must be set to a non-empty string. If using a secret or variable, ensure it is available in this workflow context.");
|
||||
}
|
||||
const privateKey = getInput("private-key");
|
||||
if (!privateKey) {
|
||||
throw new Error("The 'private-key' input must be set to a non-empty string. If using a secret or variable, ensure it is available in this workflow context.");
|
||||
}
|
||||
const enterprise = getInput("enterprise");
|
||||
const owner = getInput("owner");
|
||||
const repositories = getInput("repositories").split(/[\n,]+/).map((s) => s.trim()).filter((x) => x !== "");
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "create-github-app-token",
|
||||
"version": "3.1.1",
|
||||
"version": "3.2.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "create-github-app-token",
|
||||
"version": "3.1.1",
|
||||
"version": "3.2.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.1",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "create-github-app-token",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "3.1.1",
|
||||
"version": "3.2.0",
|
||||
"description": "GitHub Action for creating a GitHub App Installation Access Token",
|
||||
"engines": {
|
||||
"node": ">=24.4.0"
|
||||
|
||||
Reference in new issue
Block a user