Skip to content

chore(tasks): Script to clear GH cache#1848

Open
Tobbe wants to merge 1 commit into
mainfrom
tobbe-chore-tasks-clear-gh-cache
Open

chore(tasks): Script to clear GH cache#1848
Tobbe wants to merge 1 commit into
mainfrom
tobbe-chore-tasks-clear-gh-cache

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented May 29, 2026

Saving this as a good-to-have

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 81859de
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6a196066c7bb080008d9c019

@github-actions github-actions Bot added this to the chore milestone May 29, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

Adds a one-off utility script (tasks/clear-gh-cache.mts) for clearing GitHub Actions caches on the cedarjs/cedar repository. The script authenticates via the gh CLI, paginates the cache list, and then either bulk-deletes by key or deletes every cache one by one.

  • Pagination logic is correct; when the last page has exactly 100 entries the script makes one extra empty-results request, which is harmless.
  • deleteCache failures in the bulk loop are reported only as a ! character, with no cache ID, key, or HTTP status surfaced — making post-run debugging harder.
  • The shebang (#!/usr/bin/env node) will not execute a TypeScript file; tsx is needed for direct invocation.

Confidence Score: 4/5

Safe to merge — this is an internal utility script with no impact on production code paths.

The script is logically sound and the GitHub API calls are well-formed. The two issues found (wrong shebang interpreter and silent failure reporting) would only affect developers running the tool, not the framework or its users.

tasks/clear-gh-cache.mts — shebang and failure-reporting in the bulk-delete loop.

Important Files Changed

Filename Overview
tasks/clear-gh-cache.mts New utility script to clear GitHub Actions caches via the REST API. Logic is correct; minor issues with the shebang (points to node instead of tsx) and silent failure reporting in the bulk-delete loop.

Reviews (1): Last reviewed commit: "chore(tasks): Script to clear GH cache" | Re-trigger Greptile

Comment thread tasks/clear-gh-cache.mts
Comment thread tasks/clear-gh-cache.mts
Comment on lines +111 to +116
if (ok) {
deleted++
process.stdout.write('.')
} else {
process.stdout.write('!')
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 When individual cache deletions fail in the bulk-delete loop, the error is silently summarised as a ! character with no indication of which cache failed or why. Including the cache key (and optionally the HTTP status) makes it much easier to retry failed deletions.

Suggested change
if (ok) {
deleted++
process.stdout.write('.')
} else {
process.stdout.write('!')
}
if (ok) {
deleted++
process.stdout.write('.')
} else {
process.stdout.write(`\n! Failed to delete cache id=${cache.id} key="${cache.key}"`)
}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 29, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 81859de

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t build ✅ Succeeded 3s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 7s View ↗
nx run-many -t test:types ✅ Succeeded 10s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-29 09:53:20 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant