From fbf199c8569dd6c2ed85ae8b753e9afebd8d9ee1 Mon Sep 17 00:00:00 2001 From: okue Date: Mon, 2 Dec 2024 18:53:33 +0900 Subject: [PATCH] :bug: Fix cache_default_branch_only's default branch checking --- scan/dist/index.js | 2 +- scan/src/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scan/dist/index.js b/scan/dist/index.js index f6c8e0d0..870df83c 100644 --- a/scan/dist/index.js +++ b/scan/dist/index.js @@ -135346,7 +135346,7 @@ var require_utils10 = __commonJS({ core2.warning('Turn on "use-cache" option to use "cache-default-branch-only"'); } if (useCaches && cacheDefaultBranchOnly) { - const currentBranch = github2.context.payload.ref; + const currentBranch = github2.context.payload.ref_name; const defaultBranch = (_a = github2.context.payload.repository) === null || _a === void 0 ? void 0 : _a.default_branch; core2.debug(`Current branch: ${currentBranch} | Default branch: ${defaultBranch}`); return currentBranch === defaultBranch; diff --git a/scan/src/utils.ts b/scan/src/utils.ts index 42359ecb..5c736c15 100644 --- a/scan/src/utils.ts +++ b/scan/src/utils.ts @@ -360,7 +360,7 @@ export function isNeedToUploadCache( } if (useCaches && cacheDefaultBranchOnly) { - const currentBranch = github.context.payload.ref + const currentBranch = github.context.payload.ref_name const defaultBranch = github.context.payload.repository?.default_branch core.debug( `Current branch: ${currentBranch} | Default branch: ${defaultBranch}`