Adds extra caches for pulling from (binary substitution).

Creates an `extraPullNames` parameter, to mimic the existing `name`
parameter. This string should be a comma-separated set of cache names.
This commit is contained in:
Gary Coady 2020-06-23 10:28:19 +02:00
commit 49b785b55a
3 changed files with 23 additions and 0 deletions

10
dist/main/index.js vendored
View file

@ -977,6 +977,7 @@ const exec = __importStar(__webpack_require__(986));
exports.IsPost = !!process.env['STATE_isPost'];
// inputs
const name = core.getInput('name', { required: true });
const extraPullNames = core.getInput('extraPullNames');
const signingKey = core.getInput('signingKey');
const authToken = core.getInput('authToken');
const skipPush = core.getInput('skipPush');
@ -994,6 +995,15 @@ function setup() {
core.startGroup(`Cachix: using cache ` + name);
yield exec.exec('cachix', ['use', name]);
core.endGroup();
if (extraPullNames != "") {
core.startGroup(`Cachix: using extra caches ` + extraPullNames);
const extraPullNameList = extraPullNames.split(',');
for (let itemName of extraPullNameList) {
const trimmedItemName = itemName.trim();
yield exec.exec('cachix', ['use', trimmedItemName]);
}
core.endGroup();
}
if (signingKey !== "") {
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
// Remember existing store paths