From 1bccaa17153dd5b54a187fe4cb29f99f47cac4fb Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 9 Oct 2021 06:06:28 +0100 Subject: [PATCH] Emit allow-downgrade flag only on nightly with components --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3ad5183..2067242 100644 --- a/action.yml +++ b/action.yml @@ -26,12 +26,13 @@ runs: : construct rustup command line echo "::set-output name=targets::$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)" echo "::set-output name=components::$(for c in ${components//,/ }; do echo -n ' --component' $c; done)" + echo "::set-output name=downgrade::${{inputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}" env: targets: ${{inputs.target}} components: ${{inputs.components}} shell: bash - name: rustup toolchain install ${{inputs.toolchain}} - run: rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal --allow-downgrade --no-self-update + run: rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update shell: bash - run: rustup default ${{inputs.toolchain}} shell: bash