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:
Ashwin Bhat 2026-05-14 15:55:04 -07:00 committed by GitHub
parent 9eb125afe3
commit acfa366ca8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 19 deletions

View File

@ -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

View File

@ -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 != ''

View File

@ -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.`,
);

View File

@ -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...`,
);

View File

@ -309,17 +309,18 @@ 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 = () => ({
repos: {
getCollaboratorPermissionLevel: async () => {
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;
const createMockOctokitThat404s = () =>
({
repos: {
getCollaboratorPermissionLevel: async () => {
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;
},
},
},
} 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,