mirror of
https://github.com/actions/create-github-app-token.git
synced 2026-12-01 14:55:26 +00:00
chore(beta): release 3.4.0-beta (#414)
This commit is contained in:
1 parent
8240f10d3a
commit
305e4aec4e
5 files changed
+52
-10
No files matched your search
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "3.3.0"
|
||||
".": "3.4.0-beta"
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [3.4.0-beta](https://github.com/actions/create-github-app-token/compare/v3.3.0...v3.4.0-beta) (2026-11-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support GitHub Actions OIDC authentication ([#411](https://github.com/actions/create-github-app-token/issues/411)) ([8240f10](https://github.com/actions/create-github-app-token/commit/8240f10d3ae05b4d450da83e8e247111a36eaf2c))
|
||||
|
||||
## [3.3.0](https://github.com/actions/create-github-app-token/compare/v3.2.0...v3.3.0) (2026-10-12)
|
||||
|
||||
|
||||
|
||||
Vendored
+41
-6
@@ -23991,17 +23991,47 @@ async function pRetry(input, options = {}) {
|
||||
throw new Error("Retry attempts exhausted without throwing an error.");
|
||||
}
|
||||
|
||||
// lib/create-oidc-auth.js
|
||||
async function createOidcAuth(clientId, core, request2) {
|
||||
const audience = `${process.env.GITHUB_SERVER_URL || "https://github.com"}/login/oauth`;
|
||||
const token = await core.getIDToken(audience);
|
||||
const auth5 = async ({ installationId, repositoryNames, permissions }) => {
|
||||
const { data } = await request2(
|
||||
"POST /app/installations/{installation_id}/access_tokens{?client_id}",
|
||||
{
|
||||
installation_id: installationId,
|
||||
client_id: clientId,
|
||||
repositories: repositoryNames,
|
||||
permissions,
|
||||
headers: { authorization: `Bearer ${token}` }
|
||||
}
|
||||
);
|
||||
return { token: data.token, expiresAt: data.expires_at };
|
||||
};
|
||||
auth5.hook = (hookRequest, route, parameters) => {
|
||||
const endpoint2 = hookRequest.endpoint(route, parameters);
|
||||
const url = new URL(endpoint2.url);
|
||||
url.searchParams.set("client_id", clientId);
|
||||
endpoint2.url = url.toString();
|
||||
endpoint2.headers.authorization = `Bearer ${token}`;
|
||||
return hookRequest(endpoint2);
|
||||
};
|
||||
return auth5;
|
||||
}
|
||||
|
||||
// lib/main.js
|
||||
async function main(clientId, privateKey, enterprise, owner, repositories, permissions, core, createAppAuth2, request2, skipTokenRevoke) {
|
||||
if (enterprise && (owner || repositories.length > 0)) {
|
||||
throw new Error("Cannot use 'enterprise' input with 'owner' or 'repositories' inputs");
|
||||
}
|
||||
if (enterprise && !privateKey) {
|
||||
throw new Error("The 'enterprise' input requires 'private-key'; OIDC authentication is not supported for enterprise installations.");
|
||||
}
|
||||
const target = resolveInstallationTarget(enterprise, owner, repositories, core);
|
||||
const auth5 = createAppAuth2({
|
||||
appId: clientId,
|
||||
privateKey,
|
||||
request: request2
|
||||
});
|
||||
if (!privateKey) {
|
||||
core.info("No 'private-key' provided; authenticating with GitHub Actions OIDC.");
|
||||
}
|
||||
const auth5 = privateKey ? createAppAuth2({ appId: clientId, privateKey, request: request2 }) : await createOidcAuth(clientId, core, request2);
|
||||
const { authentication, installationId, appSlug } = await pRetry(
|
||||
() => getTokenFromTarget(request2, auth5, target, permissions),
|
||||
createTokenRetryOptions(core, getTokenRetryDescription(target))
|
||||
@@ -24222,7 +24252,12 @@ async function run() {
|
||||
}
|
||||
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.");
|
||||
if (!process.env.ACTIONS_ID_TOKEN_REQUEST_URL || !process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN) {
|
||||
throw new Error("The 'private-key' input must be set to a non-empty string, or the workflow must have 'id-token: write' permissions to authenticate with OIDC. If using a secret or variable, ensure it is available in this workflow context.");
|
||||
}
|
||||
if (!getInput("client-id")) {
|
||||
throw new Error("The 'client-id' input is required for OIDC authentication. The deprecated 'app-id' input is only supported with 'private-key'.");
|
||||
}
|
||||
}
|
||||
const enterprise = getInput("enterprise");
|
||||
const owner = getInput("owner");
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "create-github-app-token",
|
||||
"version": "3.3.0",
|
||||
"version": "3.4.0-beta",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "create-github-app-token",
|
||||
"version": "3.3.0",
|
||||
"version": "3.4.0-beta",
|
||||
"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.3.0",
|
||||
"version": "3.4.0-beta",
|
||||
"description": "GitHub Action for creating a GitHub App Installation Access Token",
|
||||
"engines": {
|
||||
"node": ">=24.4.0"
|
||||
|
||||
Reference in new issue
Block a user