mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
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:
parent
b5f0b56205
commit
49b785b55a
3 changed files with 23 additions and 0 deletions
|
|
@ -5,6 +5,8 @@ inputs:
|
||||||
name:
|
name:
|
||||||
description: 'Name of a cachix cache to push and pull/substitute'
|
description: 'Name of a cachix cache to push and pull/substitute'
|
||||||
required: true
|
required: true
|
||||||
|
extraPullNames:
|
||||||
|
description: 'Comma-separated list of names for extra cachix caches to pull/substitute'
|
||||||
authToken:
|
authToken:
|
||||||
description: 'Authentication token for Cachix, needed only for private cache access'
|
description: 'Authentication token for Cachix, needed only for private cache access'
|
||||||
signingKey:
|
signingKey:
|
||||||
|
|
|
||||||
10
dist/main/index.js
vendored
10
dist/main/index.js
vendored
|
|
@ -977,6 +977,7 @@ const exec = __importStar(__webpack_require__(986));
|
||||||
exports.IsPost = !!process.env['STATE_isPost'];
|
exports.IsPost = !!process.env['STATE_isPost'];
|
||||||
// inputs
|
// inputs
|
||||||
const name = core.getInput('name', { required: true });
|
const name = core.getInput('name', { required: true });
|
||||||
|
const extraPullNames = core.getInput('extraPullNames');
|
||||||
const signingKey = core.getInput('signingKey');
|
const signingKey = core.getInput('signingKey');
|
||||||
const authToken = core.getInput('authToken');
|
const authToken = core.getInput('authToken');
|
||||||
const skipPush = core.getInput('skipPush');
|
const skipPush = core.getInput('skipPush');
|
||||||
|
|
@ -994,6 +995,15 @@ function setup() {
|
||||||
core.startGroup(`Cachix: using cache ` + name);
|
core.startGroup(`Cachix: using cache ` + name);
|
||||||
yield exec.exec('cachix', ['use', name]);
|
yield exec.exec('cachix', ['use', name]);
|
||||||
core.endGroup();
|
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 !== "") {
|
if (signingKey !== "") {
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||||
// Remember existing store paths
|
// Remember existing store paths
|
||||||
|
|
|
||||||
11
src/main.ts
11
src/main.ts
|
|
@ -7,6 +7,7 @@ export const IsPost = !!process.env['STATE_isPost']
|
||||||
|
|
||||||
// inputs
|
// inputs
|
||||||
const name = core.getInput('name', { required: true });
|
const name = core.getInput('name', { required: true });
|
||||||
|
const extraPullNames = core.getInput('extraPullNames');
|
||||||
const signingKey = core.getInput('signingKey');
|
const signingKey = core.getInput('signingKey');
|
||||||
const authToken = core.getInput('authToken')
|
const authToken = core.getInput('authToken')
|
||||||
const skipPush = core.getInput('skipPush');
|
const skipPush = core.getInput('skipPush');
|
||||||
|
|
@ -27,6 +28,16 @@ async function setup() {
|
||||||
await exec.exec('cachix', ['use', name]);
|
await exec.exec('cachix', ['use', name]);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
|
|
||||||
|
if (extraPullNames != "") {
|
||||||
|
core.startGroup(`Cachix: using extra caches ` + extraPullNames);
|
||||||
|
const extraPullNameList = extraPullNames.split(',');
|
||||||
|
for (let itemName of extraPullNameList) {
|
||||||
|
const trimmedItemName = itemName.trim();
|
||||||
|
await exec.exec('cachix', ['use', trimmedItemName]);
|
||||||
|
}
|
||||||
|
core.endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
if (signingKey !== "") {
|
if (signingKey !== "") {
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||||
// Remember existing store paths
|
// Remember existing store paths
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue