mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
new: Add inherit-toolchain
input. (#6)
This commit is contained in:
parent
872c93e939
commit
6e8ea78761
5 changed files with 52 additions and 16 deletions
14
src/rust.ts
14
src/rust.ts
|
@ -69,10 +69,18 @@ export function parseConfig(configPath: string): Partial<Toolchain> {
|
|||
|
||||
const config = TOML.parse(contents) as unknown as ToolchainConfig;
|
||||
|
||||
if (config.toolchain.channel) {
|
||||
core.debug('Found channel in [toolchain] section');
|
||||
if (config.toolchain) {
|
||||
if (core.getBooleanInput('inherit-toolchain')) {
|
||||
core.debug('Inheriting entire [toolchain] section');
|
||||
|
||||
return { channel: config.toolchain.channel };
|
||||
return { ...config.toolchain };
|
||||
}
|
||||
|
||||
if (config.toolchain.channel) {
|
||||
core.debug('Found channel in [toolchain] section');
|
||||
|
||||
return { channel: config.toolchain.channel };
|
||||
}
|
||||
}
|
||||
|
||||
core.debug('No channel found in [toolchain] section');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue