Recover Jenkinsfile parse errors caused by a misplaced shebang
MSALGroovy's Antlr4 parser rejects a #! shebang that is not on the first line of the file, causing the Jenkinsfile to be ingested as a ParseError. This recipe detects that exact failure mode, relocates the shebang to line 1, and re-parses the result with the Groovy parser so downstream recipes have a usable Groovy LST to work with.
org. openrewrite. jenkins. MoveJenkinsfileShebangAndReparsemod run . --recipe= org. openrewrite. jenkins. MoveJenkinsfileShebangAndReparseInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.