https://github.com/pgreze/kotlin-main-kts-run
Custom Github Action allowing to directly run kotlin code from YAML
https://github.com/pgreze/kotlin-main-kts-run
Last synced: 3 months ago
JSON representation
Custom Github Action allowing to directly run kotlin code from YAML
- Host: GitHub
- URL: https://github.com/pgreze/kotlin-main-kts-run
- Owner: pgreze
- License: mit
- Created: 2023-05-15T08:23:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T11:35:36.000Z (over 1 year ago)
- Last Synced: 2024-04-24T13:54:56.241Z (about 1 year ago)
- Language: JavaScript
- Size: 564 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Kotlin main kts run
This simple github action will execute the provided code as
a [kotlin-main-kts script](https://github.com/Kotlin/kotlin-script-examples/blob/master/jvm/main-kts/MainKts.md).This is an alternative to the [setup-kotlin optional script parameter](https://github.com/fwilhe2/setup-kotlin#running-a-script-inline),
assuming kotlin is already installed (which is the default with ubuntu-latest).Usage:
```yaml
- 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.