Add setting.

This commit is contained in:
Miles Johnson 2023-04-25 10:02:46 -07:00
parent 872c93e939
commit ee7dba7e21
2 changed files with 14 additions and 3 deletions

View file

@ -17,6 +17,9 @@ inputs:
description: 'Comma-separated list of additional targets to install.' description: 'Comma-separated list of additional targets to install.'
profile: profile:
description: 'Profile to install. Defaults to "minimal".' description: 'Profile to install. Defaults to "minimal".'
inherit-toolchain:
description: 'Inherit all toolchain settings from the rust-toolchain.toml file.'
default: false
outputs: outputs:
cache-key: cache-key:
description: 'The generated cache key used.' description: 'The generated cache key used.'

View file

@ -69,10 +69,18 @@ export function parseConfig(configPath: string): Partial<Toolchain> {
const config = TOML.parse(contents) as unknown as ToolchainConfig; const config = TOML.parse(contents) as unknown as ToolchainConfig;
if (config.toolchain.channel) { if (config.toolchain) {
core.debug('Found channel in [toolchain] section'); 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'); core.debug('No channel found in [toolchain] section');