mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-07-28 06:48:30 +08:00
chore: bump pinned Bun to 1.3.14 (#1312)
* chore: bump pinned Bun to 1.3.14 * style: apply prettier to actor/permissions files
This commit is contained in:
parent
9eb125afe3
commit
acfa366ca8
@ -175,7 +175,7 @@ runs:
|
|||||||
if: inputs.path_to_bun_executable == ''
|
if: inputs.path_to_bun_executable == ''
|
||||||
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # https://github.com/oven-sh/setup-bun/releases/tag/v2.2.0
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # https://github.com/oven-sh/setup-bun/releases/tag/v2.2.0
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.6
|
bun-version: 1.3.14
|
||||||
token: ${{ inputs.github_token || github.token }}
|
token: ${{ inputs.github_token || github.token }}
|
||||||
|
|
||||||
- name: Setup Custom Bun Path
|
- name: Setup Custom Bun Path
|
||||||
|
|||||||
@ -99,7 +99,7 @@ runs:
|
|||||||
if: inputs.path_to_bun_executable == ''
|
if: inputs.path_to_bun_executable == ''
|
||||||
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # https://github.com/oven-sh/setup-bun/releases/tag/v2.2.0
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # https://github.com/oven-sh/setup-bun/releases/tag/v2.2.0
|
||||||
with:
|
with:
|
||||||
bun-version: 1.3.6
|
bun-version: 1.3.14
|
||||||
|
|
||||||
- name: Setup Custom Bun Path
|
- name: Setup Custom Bun Path
|
||||||
if: inputs.path_to_bun_executable != ''
|
if: inputs.path_to_bun_executable != ''
|
||||||
|
|||||||
@ -60,9 +60,7 @@ export async function checkHumanActor(
|
|||||||
(error.message.includes("Not Found") ||
|
(error.message.includes("Not Found") ||
|
||||||
error.message.includes("is not a user"))
|
error.message.includes("is not a user"))
|
||||||
) {
|
) {
|
||||||
const botName = githubContext.actor
|
const botName = githubContext.actor.toLowerCase().replace(/\[bot\]$/, "");
|
||||||
.toLowerCase()
|
|
||||||
.replace(/\[bot\]$/, "");
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Workflow initiated by non-human actor: ${botName} (actor not found on GitHub). Add bot to allowed_bots list or use '*' to allow all bots.`,
|
`Workflow initiated by non-human actor: ${botName} (actor not found on GitHub). Add bot to allowed_bots list or use '*' to allow all bots.`,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -102,10 +102,7 @@ export async function checkWritePermissions(
|
|||||||
// Handle 404 errors for non-user actors (e.g. GitHub Apps like Copilot
|
// Handle 404 errors for non-user actors (e.g. GitHub Apps like Copilot
|
||||||
// whose GITHUB_ACTOR doesn't end with [bot]).
|
// whose GITHUB_ACTOR doesn't end with [bot]).
|
||||||
// The collaborator permission API only works for user accounts.
|
// The collaborator permission API only works for user accounts.
|
||||||
if (
|
if (error instanceof Error && error.message.includes("is not a user")) {
|
||||||
error instanceof Error &&
|
|
||||||
error.message.includes("is not a user")
|
|
||||||
) {
|
|
||||||
core.info(
|
core.info(
|
||||||
`Actor ${actor} is not a GitHub user (likely a GitHub App). Checking allowed_bots...`,
|
`Actor ${actor} is not a GitHub user (likely a GitHub App). Checking allowed_bots...`,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -309,17 +309,18 @@ describe("checkWritePermissions", () => {
|
|||||||
// end with [bot] and is not a valid GitHub user, so the collaborator
|
// end with [bot] and is not a valid GitHub user, so the collaborator
|
||||||
// permission API returns 404 with "is not a user".
|
// permission API returns 404 with "is not a user".
|
||||||
|
|
||||||
const createMockOctokitThat404s = () => ({
|
const createMockOctokitThat404s = () =>
|
||||||
repos: {
|
({
|
||||||
getCollaboratorPermissionLevel: async () => {
|
repos: {
|
||||||
const err = new Error(
|
getCollaboratorPermissionLevel: async () => {
|
||||||
"HttpError: Copilot is not a user - https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user",
|
const err = new Error(
|
||||||
);
|
"HttpError: Copilot is not a user - https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user",
|
||||||
(err as any).status = 404;
|
);
|
||||||
throw err;
|
(err as any).status = 404;
|
||||||
|
throw err;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
}) as any;
|
||||||
} as any);
|
|
||||||
|
|
||||||
test("should return true for non-[bot] actor in allowed_bots (pre-API check)", async () => {
|
test("should return true for non-[bot] actor in allowed_bots (pre-API check)", async () => {
|
||||||
// The allowed_bots check should happen BEFORE calling the API,
|
// The allowed_bots check should happen BEFORE calling the API,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user