Skip to content

Kotlin main kts runner

Actions
Run the given code as a main.kts script
v1
Latest
Star (1)

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.

Kotlin main kts runner is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run the given code as a main.kts script
v1
Latest

Kotlin main kts runner is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.