Skip to content

Commit

Permalink
🐛 Fix cache_default_branch_only's default branch checking
Browse files Browse the repository at this point in the history
  • Loading branch information
okue authored and tiulpin committed Dec 3, 2024
1 parent aeaf4aa commit fbf199c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scan/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scan/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down

0 comments on commit fbf199c

Please sign in to comment.