diff --git a/README.md b/README.md index 563f973..f6c661a 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ jobs: with: toolchain: nightly override: true + component: clippy # `cargo check` command here will use installed `nightly` # as it set as an "override" for current directory @@ -44,6 +45,7 @@ See [additional recipes here](https://github.com/actions-rs/meta). * `target`: Additionally install specific target for this toolchain (ex. `x86_64-apple-darwin`) * `default`: Set installed toolchain as default (executes `rustup toolchain default {toolchain}`) * `override`: Set installed toolchain as an override for current directory +* `component`: Set additional component (see the below section) to add to the toolchain ## Components diff --git a/src/args.ts b/src/args.ts index e3fe0b9..167707a 100644 --- a/src/args.ts +++ b/src/args.ts @@ -30,7 +30,8 @@ export interface ToolchainOptions { name: string, target?: string, default: boolean, - override: boolean + override: boolean, + component?: string } export function toolchain_args(): ToolchainOptions { @@ -38,6 +39,7 @@ export function toolchain_args(): ToolchainOptions { name: getInput('toolchain', {required: true}), target: getInput('target') || undefined, default: inputBoolean('default'), - override: inputBoolean('override') + override: inputBoolean('override'), + component: getInput('component') || undefined }; } diff --git a/src/main.ts b/src/main.ts index 1f316e9..44b4653 100644 --- a/src/main.ts +++ b/src/main.ts @@ -89,6 +89,10 @@ async function run() { if (opts.target) { await exec.exec(rustup, ['target', 'add', '--toolchain', opts.name, opts.target]); } + + if (opts.component) { + await exec.exec(rustup, ['component', 'add', opts.component, '--toolchain', opts.name]); + } } async function main() {