Repository: scala-steward-org/scala-steward (scala)

Issue:
`java.io.IOException: Cannot run program "scala-cli"`
I'm a little puzzled what's going on 🤔 

https://github.com/typelevel/steward/actions/runs/4034855994/jobs/6936380468

```
2023-01-29 03:14:57,119 ERROR Steward typelevel/cats-effect:series/3.x failed
  java.io.IOException: Cannot run program "scala-cli" (in directory "/home/runner/scala-steward/workspace/repos/typelevel/cats-effect"): error=2, No such file or directory
  	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
  	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
  	at org.scalasteward.core.io.process$.$anonfun$createProcess$5(process.scala:81)
  	at flatMap @ org.scalasteward.core.io.process$.createProcess(process.scala:79)
  	at flatMap @ org.scalasteward.core.io.process$.slurp(process.scala:43)
  	at delay @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.isDebugEnabled(Slf4jLoggerInternal.scala:65)
  	at ifM$extension @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.info(Slf4jLoggerInternal.scala:91)
  	at >>$extension @ org.scalasteward.core.io.ProcessAlg$.$anonfun$create$1(ProcessAlg.scala:92)
  	at map @ org.scalasteward.core.buildtool.scalacli.ScalaCliAlg.$anonfun$getDependencies$2(ScalaCliAlg.scala:54)
  	at flatMap @ org.scalasteward.core.buildtool.scalacli.ScalaCliAlg.$anonfun$getDependencies$2(ScalaCliAlg.scala:54)
  	at map @ org.scalasteward.core.buildtool.scalacli.ScalaCliAlg.getDependencies(ScalaCliAlg.scala:50)
  	at flatMap @ org.scalasteward.core.buildtool.scalacli.ScalaCliAlg.getDependencies(ScalaCliAlg.scala:50)
  	at delay @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.$anonfun$info$4(Slf4jLoggerInternal.scala:91)
  	at delay @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.isInfoEnabled(Slf4jLoggerInternal.scala:66)
  	at ifM$extension @ org.typelevel.log4cats.slf4j.internal.Slf4jLoggerInternal$Slf4jLogger.info(Slf4jLoggerInternal.scala:91)
  	at >>$extension @ org.scalasteward.core.io.ProcessAlg$.$anonfun$create$1(ProcessAlg.scala:92)
  Caused by: java.io.IOException: error=2, No such file or directory
  	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
  	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
  	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
  	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
  	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
  	at org.scalasteward.core.io.process$.$anonfun$createProcess$5(process.scala:81)
  	at cats.effect.unsafe.WorkerThread.blockOn(WorkerThread.scala:631)
  	at scala.concurrent.package$.blocking(package.scala:124)
  	at cats.effect.IOFiber.runLoop(IOFiber.scala:953)
  	at cats.effect.IOFiber.asyncContinueSuccessfulR(IOFiber.scala:1325)
  	at cats.effect.IOFiber.run(IOFiber.scala:119)
  	at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:585)
  2023-01-29 03:14:57,126 INFO  ──────────── Total time: Steward typelevel/cats-effect:series/3.x: 1m 32s 74ms 
```

Pull request:
Closes #2948

Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala
index 63e9370ad6..123564ec0d 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala
@@ -41,9 +41,10 @@ final class ScalaCliAlg[F[_]](implicit
 
   override def containsBuild(buildRoot: BuildRoot): F[Boolean] = {
     val buildRootPath = buildRoot.relativePath.dropWhile(Set('.', '/'))
+    val extensions = Set(".sc", ".scala")
     gitAlg
       .findFilesContaining(buildRoot.repo, "//> using lib ")
-      .map(_.exists(_.startsWith(buildRootPath)))
+      .map(_.exists(path => path.startsWith(buildRootPath) && extensions.exists(path.endsWith)))
   }
 
   override def getDependencies(buildRoot: BuildRoot): F[List[Scope.Dependencies]] =


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala
index 85fcbac63e..b0baea4471 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala
@@ -5,12 +5,25 @@ import org.scalasteward.core.buildtool.BuildRoot
 import org.scalasteward.core.buildtool.sbt.command._
 import org.scalasteward.core.data.{GroupId, Repo, Version}
 import org.scalasteward.core.edit.scalafix.ScalafixMigration
+import org.scalasteward.core.git.FileGitAlg
 import org.scalasteward.core.mock.MockContext.context._
 import org.scalasteward.core.mock.MockState
 import org.scalasteward.core.mock.MockState.TraceEntry.{Cmd, Log}
 import org.scalasteward.core.util.Nel
 
 class ScalaCliAlgTest extends CatsEffectSuite {
+  test("containsBuild: directive in non-source file") {
+    val repo = Repo("user", "repo")
+    val buildRoot = BuildRoot(repo, ".")
+    val fileWithUsingLib = "test.md" // this test fails if the extension is .scala or .sc
+    val grepCmd = FileGitAlg.gitCmd.toList ++
+      List("grep", "-I", "--fixed-strings", "--files-with-matches", "//> using lib ")
+    val initial =
+      MockState.empty.copy(commandOutputs = Map(grepCmd -> Right(List(fileWithUsingLib))))
+    val obtained = scalaCliAlg.containsBuild(buildRoot).runA(initial)
+    assertIO(obtained, false)
+  }
+
   test("getDependencies") {
     val repo = Repo("user", "repo")
     val buildRoot = BuildRoot(repo, ".")