mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-07-27 22:38: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 == ''
|
||||
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # https://github.com/oven-sh/setup-bun/releases/tag/v2.2.0
|
||||
with:
|
||||
bun-version: 1.3.6
|
||||
bun-version: 1.3.14
|
||||
token: ${{ inputs.github_token || github.token }}
|
||||
|
||||
- name: Setup Custom Bun Path
|
||||
|
||||
@ -99,7 +99,7 @@ runs:
|
||||
if: inputs.path_to_bun_executable == ''
|
||||
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # https://github.com/oven-sh/setup-bun/releases/tag/v2.2.0
|
||||
with:
|
||||
bun-version: 1.3.6
|
||||
bun-version: 1.3.14
|
||||
|
||||
- name: Setup Custom Bun Path
|
||||
if: inputs.path_to_bun_executable != ''
|
||||
|
||||
@ -60,9 +60,7 @@ export async function checkHumanActor(
|
||||
(error.message.includes("Not Found") ||
|
||||
error.message.includes("is not a user"))
|
||||
) {
|
||||
const botName = githubContext.actor
|
||||
.toLowerCase()
|
||||
.replace(/\[bot\]$/, "");
|
||||
const botName = githubContext.actor.toLowerCase().replace(/\[bot\]$/, "");
|
||||
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.`,
|
||||
);
|
||||
|
||||
@ -102,10 +102,7 @@ export async function checkWritePermissions(
|
||||
// Handle 404 errors for non-user actors (e.g. GitHub Apps like Copilot
|
||||
// whose GITHUB_ACTOR doesn't end with [bot]).
|
||||
// The collaborator permission API only works for user accounts.
|
||||
if (
|
||||
error instanceof Error &&
|
||||
error.message.includes("is not a user")
|
||||
) {
|
||||
if (error instanceof Error && error.message.includes("is not a user")) {
|
||||
core.info(
|
||||
`Actor ${actor} is not a GitHub user (likely a GitHub App). Checking allowed_bots...`,
|
||||
);
|
||||
|
||||
@ -309,7 +309,8 @@ describe("checkWritePermissions", () => {
|
||||
// end with [bot] and is not a valid GitHub user, so the collaborator
|
||||
// permission API returns 404 with "is not a user".
|
||||
|
||||
const createMockOctokitThat404s = () => ({
|
||||
const createMockOctokitThat404s = () =>
|
||||
({
|
||||
repos: {
|
||||
getCollaboratorPermissionLevel: async () => {
|
||||
const err = new Error(
|
||||
@ -319,7 +320,7 @@ describe("checkWritePermissions", () => {
|
||||
throw err;
|
||||
},
|
||||
},
|
||||
} as any);
|
||||
}) as any;
|
||||
|
||||
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user