diff --git a/README.md b/README.md index a18ac44..38db1de 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,15 @@ jobs: ## 🧩 Input +> **ℹ️ Notice:** All of the inputs are optional; Use this action without any input will default to install latest version for current user, and keep the setting that modified. + ### `sudo` -**(>= v1.5.0) \[Optional\]** `` Whether to execute this action in sudo mode on non-Windows environment. This must set to `True` in order to able install for all users on non-Windows environment (i.e.: when input [`scope`](#scope) is `"AllUsers"`). +**(>= v1.5.0)** `` Whether to execute this action in sudo mode on non-Windows environment. This must set to `True` in order to able install for all users on non-Windows environment (i.e.: when [input `scope`](#scope) is `"AllUsers"`). ### `version` -**\[Optional\]** `` Target version, by Semantic Versioning (SemVer) 2.0.0 with optional modifier; Default to the latest version. +`` Target version, by Semantic Versioning (SemVer) 2.0.0 with optional modifier; Default to the latest version. - **`Latest`:** Latest version - **`` Whether to allow target pre release version. +`` Whether to allow target pre release version. ### `scope` -**(>= v1.5.0) \[Optional\]** `` Installation scope. +**(>= v1.5.0)** `` Installation scope. -- **`"AllUsers"`:** For all users. Also need to set input [`sudo`](#sudo) to `True`. +- **`"AllUsers"`:** For all users. Also need to set [input `sudo`](#sudo) to `True`. - **`"CurrentUser"`:** For current user. ### `force` -**(>= v1.5.0) \[Optional\]** `` Whether to force install or reinstall target (pre release) version. +**(>= v1.5.0)** `` Whether to force install or reinstall target (pre release) version. ### `keepsetting` -**\[Optional\]** `` Whether to keep the setting that modified by this action. +`` Whether to keep the setting that modified by this action. ## 🧩 Output diff --git a/action.yml b/action.yml index c2b0bd0..6d6a4b7 100644 --- a/action.yml +++ b/action.yml @@ -71,48 +71,6 @@ runs: INPUT_SCOPE: "${{inputs.scope}}" INPUT_SUDO: "${{inputs.sudo}}" INPUT_VERSION: "${{inputs.toolkit_version || inputs.version}}" - # - name: "Throw Error - Input `sudo`" - # if: "${{inputs.sudo != 'False' && inputs.sudo != 'True'}}" - # run: | - # Write-Host -Object '::error::Input `sudo` is not a boolean!' - # Exit 1 - # shell: "pwsh" - # - name: "Main (Non-Windows)" - # if: "${{runner.os != 'Windows' && inputs.sudo == 'False'}}" - # env: - # INPUT_ALLOWPRERELEASE: "${{inputs.toolkit_allowprerelease || inputs.allowprerelease}}" - # INPUT_FORCE: "${{inputs.force}}" - # INPUT_KEEPSETTING: "${{inputs.keepsetting}}" - # INPUT_SCOPE: "${{inputs.scope}}" - # INPUT_SUDO: "${{inputs.sudo}}" - # INPUT_VERSION: "${{inputs.toolkit_version || inputs.version}}" - # run: | - # pwsh -NonInteractive "$GITHUB_ACTION_PATH/main.ps1" - # shell: "sh" - # - name: "Main (Non-Windows, Sudo)" - # if: "${{runner.os != 'Windows' && inputs.sudo == 'True'}}" - # env: - # INPUT_ALLOWPRERELEASE: "${{inputs.toolkit_allowprerelease || inputs.allowprerelease}}" - # INPUT_FORCE: "${{inputs.force}}" - # INPUT_KEEPSETTING: "${{inputs.keepsetting}}" - # INPUT_SCOPE: "${{inputs.scope}}" - # INPUT_SUDO: "${{inputs.sudo}}" - # INPUT_VERSION: "${{inputs.toolkit_version || inputs.version}}" - # run: | - # sudo --non-interactive --preserve-env pwsh -NonInteractive "$GITHUB_ACTION_PATH/main.ps1" - # shell: "sh" - # - name: "Main (Windows)" - # if: "${{runner.os == 'Windows'}}" - # env: - # INPUT_ALLOWPRERELEASE: "${{inputs.toolkit_allowprerelease || inputs.allowprerelease}}" - # INPUT_FORCE: "${{inputs.force}}" - # INPUT_KEEPSETTING: "${{inputs.keepsetting}}" - # INPUT_SCOPE: "${{inputs.scope}}" - # INPUT_SUDO: "${{inputs.sudo}}" - # INPUT_VERSION: "${{inputs.toolkit_version || inputs.version}}" - # run: | - # pwsh -NonInteractive (Join-Path -Path $Env:GITHUB_ACTION_PATH -ChildPath 'main.ps1') - # shell: "pwsh" branding: icon: "package" color: "blue"