-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add cache-write input for read-only cache mode #1508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,12 @@ process.on('uncaughtException', e => { | |
| // Added early exit to resolve issue with slow post action step: | ||
| export async function run(earlyExit?: boolean) { | ||
| try { | ||
| const cacheWriteEnabled = core.getInput('cache-write'); | ||
| if (cacheWriteEnabled === 'false') { | ||
| core.info('Cache write is disabled (read-only mode). Skipping cache save.'); | ||
| return; | ||
| } | ||
|
Comment on lines
+19
to
+25
|
||
|
|
||
| const cacheLock = core.getState(State.CachePackageManager); | ||
|
|
||
| if (cacheLock) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cache-writeis being treated as a raw string and only disables saving when the value is exactly'false'. This is inconsistent with how other boolean-like inputs in this repo are parsed (case-insensitive), and it also misses values likeFALSE/False/ whitespace. Consider normalizing the input (e.g.,(core.getInput('cache-write') || 'true').trim().toUpperCase() === 'TRUE') or switching tocore.getBooleanInputso the behavior is reliably boolean.