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

@ -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"