This commit is contained in:
Salman Chishti 2026-03-09 14:46:23 +00:00 committed by GitHub
commit ccb299a94a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View file

@ -17,6 +17,9 @@ inputs:
default: true
cache-dependency-path:
description: 'Used to specify the path to a dependency file (e.g., go.mod, go.sum)'
cache-write:
description: 'Whether to save the cache at the end of the workflow. Set to false for cache read-only mode, useful for preventing cache poisoning from untrusted PR builds.'
default: true
architecture:
description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.'
outputs:

View file

@ -71548,6 +71548,11 @@ process.on('uncaughtException', e => {
function run(earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
try {
const cacheWriteEnabled = core.getInput('cache-write');
if (cacheWriteEnabled === 'false') {
core.info('Cache write is disabled (read-only mode). Skipping cache save.');
return;
}
const cacheInput = core.getBooleanInput('cache');
if (cacheInput) {
yield cachePackages();

View file

@ -18,6 +18,14 @@ process.on('uncaughtException', e => {
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;
}
const cacheInput = core.getBooleanInput('cache');
if (cacheInput) {
await cachePackages();