Add errors if options conflict

This commit is contained in:
Ana Hobden 2023-01-31 07:44:42 -08:00
parent 6d99d4ce08
commit 3764baabb9

View file

@ -52,7 +52,7 @@ inputs:
description: The root disk of the target (Mac only) description: The root disk of the target (Mac only)
required: false required: false
start-daemon: start-daemon:
description: "If the daemon should be started , requires `planner: linux-multi`" description: "If the daemon should be started, requires `planner: linux-multi`"
required: false required: false
init: init:
description: "The init system to configure, requires `planner: linux-multi` (allowing the choice between `none` or `systemd`)" description: "The init system to configure, requires `planner: linux-multi` (allowing the choice between `none` or `systemd`)"
@ -62,7 +62,7 @@ inputs:
required: false required: false
logger: logger:
description: The logger to use for install (eg. `pretty`, `json`, `full`, `compact`) description: The logger to use for install (eg. `pretty`, `json`, `full`, `compact`)
required: falseg required: false
local-root: local-root:
description: A local `nix-installer` binary root, overrides the `nix-installer-url` setting (a `nix-installer.sh` should exist, binaries should be named `nix-installer-$ARCH`, eg. `nix-installer-x86_64-linux`) description: A local `nix-installer` binary root, overrides the `nix-installer-url` setting (a `nix-installer.sh` should exist, binaries should be named `nix-installer-$ARCH`, eg. `nix-installer-x86_64-linux`)
required: false required: false
@ -113,21 +113,6 @@ runs:
fi fi
fi fi
if [ -n "${{ inputs.nix-installer-tag }}" ]; then
export NIX_INSTALLER_TAG=${{ inputs.nix-installer-tag }}
echo "Set NIX_INSTALLER_TAG=$NIX_INSTALLER_TAG"
fi
if [ -n "${{ inputs.nix-installer-revision }}" ]; then
export NIX_INSTALLER_TAG=${{ inputs.nix-installer-revision }}
echo "Set NIX_INSTALLER_TAG=$NIX_INSTALLER_TAG"
fi
if [ -n "${{ inputs.nix-installer-branch }}" ]; then
export NIX_INSTALLER_BRANCH=${{ inputs.nix-installer-branch }}
echo "Set NIX_INSTALLER_BRANCH=$NIX_INSTALLER_BRANCH"
fi
if [ -n "${{ inputs.channels }}" ]; then if [ -n "${{ inputs.channels }}" ]; then
export NIX_INSTALLER_CHANNELS=${{ inputs.channels }} export NIX_INSTALLER_CHANNELS=${{ inputs.channels }}
echo "Set NIX_INSTALLER_CHANNELS=$NIX_INSTALLER_CHANNELS" echo "Set NIX_INSTALLER_CHANNELS=$NIX_INSTALLER_CHANNELS"
@ -202,6 +187,31 @@ runs:
echo "Set NIX_INSTALLER_ROOT_DISK=$NIX_INSTALLER_ROOT_DISK" echo "Set NIX_INSTALLER_ROOT_DISK=$NIX_INSTALLER_ROOT_DISK"
fi fi
if [ -n "${{ inputs.nix-installer-pr }}" ] && [ -n "${{ inputs.nix-installer-tag }}" ]; then
echo "The nix-installer-pr and nix-installer-tag options conflict, please choose one"
exit 1
fi
if [ -n "${{ inputs.nix-installer-pr }}" ] && [ -n "${{ inputs.nix-installer-revision }}" ]; then
echo "The nix-installer-pr and nix-installer-revision options conflict, please choose one"
exit 1
fi
if [ -n "${{ inputs.nix-installer-pr }}" ] && [ -n "${{ inputs.nix-installer-branch }}" ]; then
echo "The nix-installer-pr and nix-installer-branch options conflict, please choose one"
exit 1
fi
if [ -n "${{ inputs.nix-installer-tag }}" ] && [ -n "${{ inputs.nix-installer-revision }}" ]; then
echo "The nix-installer-tag and nix-installer-revision options conflict, please choose one"
exit 1
fi
if [ -n "${{ inputs.nix-installer-branch }}" ] && [ -n "${{ inputs.nix-installer-revision }}" ]; then
echo "The nix-installer-branch and nix-installer-revision options conflict, please choose one"
exit 1
fi
if [ -n "${{ inputs.nix-installer-tag }}" ] && [ -n "${{ inputs.nix-installer-branch }}" ]; then
echo "The nix-installer-tag and nix-installer-branch options conflict, please choose one"
exit 1
fi
if [ -n "${{ inputs.local-root }}" ]; then if [ -n "${{ inputs.local-root }}" ]; then
if [ "$RUNNER_OS" == "macOS" ]; then if [ "$RUNNER_OS" == "macOS" ]; then
export PYTHON="python3" export PYTHON="python3"