Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined rust channel in rust-toolchain file #219

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11515,7 +11515,7 @@ function getManifestDir(args) {
function parseRustToolchain(content) {
const toml = (0, toml_1.parse)(content.toString());
const toolchain = toml === null || toml === void 0 ? void 0 : toml.toolchain;
return toolchain === null || toolchain === void 0 ? void 0 : toolchain.channel;
return (toolchain === null || toolchain === void 0 ? void 0 : toolchain.channel) || '';
}
async function getRustToolchain(args) {
let rustToolchain = core.getInput('rust-toolchain');
Expand Down Expand Up @@ -11940,7 +11940,7 @@ function setupSccacheEnv() {
async function hostBuild(maturinRelease, args) {
const command = core.getInput('command');
const target = getRustTarget(args);
const rustToolchain = await getRustToolchain(args);
const rustToolchain = (await getRustToolchain(args)) || 'stable';
const rustupComponents = core.getInput('rustup-components');
const workdir = getWorkingDirectory();
const sccache = core.getBooleanInput('sccache');
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function getManifestDir(args: string[]): string {
function parseRustToolchain(content: string): string {
const toml = parseTOML(content.toString())
const toolchain = toml?.toolchain as JsonMap
return toolchain?.channel as string
return (toolchain?.channel as string) || ''
}

async function getRustToolchain(args: string[]): Promise<string> {
Expand Down Expand Up @@ -759,7 +759,7 @@ async function hostBuild(
): Promise<number> {
const command = core.getInput('command')
const target = getRustTarget(args)
const rustToolchain = await getRustToolchain(args)
const rustToolchain = (await getRustToolchain(args)) || 'stable'
const rustupComponents = core.getInput('rustup-components')
const workdir = getWorkingDirectory()
const sccache = core.getBooleanInput('sccache')
Expand Down
Loading