Skip to content

Custom Github Action allowing to directly run kotlin code from YAML

License

Notifications You must be signed in to change notification settings

pgreze/kotlin-main-kts-run

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Kotlin main kts run

This simple github action will execute the provided code as a kotlin-main-kts script.

This is an alternative to the setup-kotlin optional script parameter, assuming kotlin is already installed (which is the default with ubuntu-latest).

Usage:

    - uses: pgreze/kotlin-main-kts-run@v1
      with:
        script: |
            println("Hello from kotlin")

FAQ

Why not just use run: with shell: kotlin {0}?

Because run: code is stored in a random generated name, but the kotlin compiler is expecting a filename suffixed with .main.kts which is not possible without extra logic/steps. This action is allowing a one-step declaration without hack.

About

Custom Github Action allowing to directly run kotlin code from YAML

Resources

License

Stars

Watchers

Forks

Packages

No packages published