Files
setup-zig/post.js
T
mlugg 586e886fb4 Add use-cache option
This option can be used to disable preservation of the global Zig cache
directory across runs. This option is only applicable in rare cases, and
should not be used by the majority of users.
2024-06-11 23:31:54 +01:00

19 lines
480 B
JavaScript

const core = require('@actions/core');
const github = require('@actions/github');
const cache = require('@actions/cache');
const common = require('./common');
async function main() {
try {
if (core.getBooleanInput('use-cache')) {
const prefix = await common.getCachePrefix();
const name = prefix + github.context.runId;
await cache.saveCache([await common.getZigCachePath()], name);
}
} catch (err) {
core.setFailed(err.message);
}
}
main();