Skip to content

Commit 4fd6c0d

Browse files
committed
Look at ref rather than default branch
Since we'll only cleanup when running on the default branch
1 parent 087f0b0 commit 4fd6c0d

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

lib/trap-caching.js

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/trap-caching.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/trap-caching.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,9 @@ export async function cleanupTrapCaches(language: Language, logger: Logger) {
175175
async function getTrapCachesForLanguage(
176176
language: Language,
177177
): Promise<apiClient.ActionsCacheItem[]> {
178-
const event = actionsUtil.getWorkflowEvent();
179-
const defaultBranch = event?.repository?.default_branch as string | undefined;
180-
181-
if (!defaultBranch) {
182-
throw new Error("Could not determine default branch");
183-
}
184-
185178
const allCaches = await apiClient.listActionsCaches(
186179
CODEQL_TRAP_CACHE_PREFIX,
187-
defaultBranch,
180+
await actionsUtil.getRef(),
188181
);
189182

190183
return allCaches.filter((cache) => {

0 commit comments

Comments
 (0)