new: Add inherit-toolchain input. (#6)

This commit is contained in:
Miles Johnson 2023-04-25 10:16:40 -07:00 committed by GitHub
parent 872c93e939
commit 6e8ea78761
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 16 deletions

View file

@ -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');