mirror of
https://github.com/actions/setup-go.git
synced 2026-05-06 03:34:24 +00:00
Merge 4a6270ada6 into 4a3601121d
This commit is contained in:
commit
afe1e86fd4
3 changed files with 16 additions and 0 deletions
|
|
@ -17,6 +17,9 @@ inputs:
|
||||||
default: true
|
default: true
|
||||||
cache-dependency-path:
|
cache-dependency-path:
|
||||||
description: 'Used to specify the path to a dependency file (e.g., go.mod, go.sum)'
|
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:
|
architecture:
|
||||||
description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.'
|
description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.'
|
||||||
go-download-base-url:
|
go-download-base-url:
|
||||||
|
|
|
||||||
5
dist/cache-save/index.js
vendored
5
dist/cache-save/index.js
vendored
|
|
@ -71548,6 +71548,11 @@ process.on('uncaughtException', e => {
|
||||||
function run(earlyExit) {
|
function run(earlyExit) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
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');
|
const cacheInput = core.getBooleanInput('cache');
|
||||||
if (cacheInput) {
|
if (cacheInput) {
|
||||||
yield cachePackages();
|
yield cachePackages();
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,14 @@ process.on('uncaughtException', e => {
|
||||||
|
|
||||||
export async function run(earlyExit?: boolean) {
|
export async function run(earlyExit?: boolean) {
|
||||||
try {
|
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');
|
const cacheInput = core.getBooleanInput('cache');
|
||||||
if (cacheInput) {
|
if (cacheInput) {
|
||||||
await cachePackages();
|
await cachePackages();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue