Recover Jenkinsfile parse errors caused by a misplaced shebang

MSAL

Groovy'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.MoveJenkinsfileShebangAndReparse
mod run . --recipe=org.openrewrite.jenkins.MoveJenkinsfileShebangAndReparse

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.