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: Allow non-yaml files in .moon/tasks. #1080

Merged
merged 2 commits into from
Sep 28, 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
9 changes: 9 additions & 0 deletions .yarn/versions/8dfb2dc3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@moonrepo/cli": patch
"@moonrepo/core-linux-arm64-gnu": patch
"@moonrepo/core-linux-arm64-musl": patch
"@moonrepo/core-linux-x64-gnu": patch
"@moonrepo/core-linux-x64-musl": patch
"@moonrepo/core-macos-arm64": patch
"@moonrepo/core-macos-x64": patch
"@moonrepo/core-windows-x64-msvc": patch
17 changes: 12 additions & 5 deletions nextgen/config/src/inherited_tasks_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,18 @@ fn load_dir(
})?;

if file_type.is_file() {
manager.add_config(
workspace_root,
&path,
InheritedTasksConfig::load_partial(workspace_root, &path)?,
);
// Non-yaml files may be located in these folders,
// so avoid failing when trying to parse it as a config
if path
.extension()
.is_some_and(|ext| ext == "yml" || ext == "yaml")
{
manager.add_config(
workspace_root,
&path,
InheritedTasksConfig::load_partial(workspace_root, &path)?,
);
}
} else if file_type.is_dir() {
load_dir(manager, workspace_root, &path)?;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
- More accurately monitors signals (ctrl+c) and shutdowns.
- Tasks can now be configured with a timeout.

## Unreleased

#### 🐞 Fixes

- Fixed an issue where non-YAML files in `.moon/tasks` would be parsed as YAML configs.

## 1.14.1

#### 🐞 Fixes
Expand Down