Skip to content

Commit f671908

Browse files
committed
rust: filter workflows by path not name
This logic broke due to commit 42cbccf. Unintended consequences. Add error checking for empty vec to next time it raises an error instead of silently finishing as a no-op.
1 parent 61ace30 commit f671908

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/github.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
130130
.into_iter()
131131
.filter_map(|wf| {
132132
if matches!(
133-
wf.name.as_str(),
133+
wf.path.as_str(),
134134
".github/workflows/apple.yml"
135135
| ".github/workflows/linux.yml"
136136
| ".github/workflows/windows.yml"
@@ -144,6 +144,12 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
144144
})
145145
.collect::<Vec<_>>();
146146

147+
if workflow_ids.is_empty() {
148+
return Err(anyhow!(
149+
"failed to find any workflows; this should not happen"
150+
));
151+
}
152+
147153
let mut runs: Vec<octocrab::models::workflows::Run> = vec![];
148154

149155
for workflow_id in workflow_ids {

0 commit comments

Comments
 (0)