mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
Add pathsToPush and cachixArgs
Give more control to the user over exactly what is pushed and how.
This commit is contained in:
parent
36e4e513e8
commit
e62abb7d2d
4 changed files with 19 additions and 7 deletions
4
dist/main/index.js
vendored
4
dist/main/index.js
vendored
|
|
@ -1042,8 +1042,10 @@ const extraPullNames = core.getInput('extraPullNames');
|
|||
const signingKey = core.getInput('signingKey');
|
||||
const authToken = core.getInput('authToken');
|
||||
const skipPush = core.getInput('skipPush');
|
||||
const pathsToPush = core.getInput('pathsToPush');
|
||||
const pushFilter = core.getInput('pushFilter');
|
||||
const cachixExecutable = process.env.HOME + '/.nix-profile/bin/cachix';
|
||||
const cachixArgs = core.getInput('cachixArgs');
|
||||
const installCommand = core.getInput('installCommand') ||
|
||||
"nix-env --quiet -j8 -iA cachix -f https://cachix.org/api/v1/install";
|
||||
function setup() {
|
||||
|
|
@ -1087,7 +1089,7 @@ function upload() {
|
|||
core.info('Pushing is disabled as skipPush is set to true');
|
||||
}
|
||||
else if (signingKey !== "" || authToken !== "") {
|
||||
yield exec.exec(`${__dirname}/push-paths.sh`, [cachixExecutable, name, pushFilter]);
|
||||
yield exec.exec(`${__dirname}/push-paths.sh`, [cachixExecutable, cachixArgs, name, pathsToPush, pushFilter]);
|
||||
}
|
||||
else {
|
||||
core.info('Pushing is disabled as signingKey nor authToken are set (or are emtpy?) in your YAML file.');
|
||||
|
|
|
|||
12
dist/main/push-paths.sh
vendored
12
dist/main/push-paths.sh
vendored
|
|
@ -1,10 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PATHS=$(comm -13 <(sort /tmp/store-path-pre-build) <("$(dirname "$0")"/list-nix-store.sh))
|
||||
cachix=$1 cachixArgs=${2:--j8} cache=$3 pathsToPush=$4 pushFilter=$5
|
||||
|
||||
if [[ $3 != "" ]]; then
|
||||
PATHS=$(echo "$PATHS" | grep -vEe "$3")
|
||||
if [[ $pathsToPush == "" ]]; then
|
||||
pathsToPush=$(comm -13 <(sort /tmp/store-path-pre-build) <("$(dirname "$0")"/list-nix-store.sh))
|
||||
|
||||
if [[ $pushFilter != "" ]]; then
|
||||
pathsToPush=$(echo "$pathsToPush" | grep -vEe "$pushFilter")
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$PATHS" | "$1" push -j8 "$2"
|
||||
echo "$pathsToPush" | "$cachix" push $cachixArgs "$cache"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue