<@U01681FLZC2> I’d like to continue the discussion...
# github-workflows-kt
p
@Adam S I’d like to continue the discussion on a custom script context: https://kotlinlang.slack.com/archives/C0B8MA7FA/p1676989225653899?thread_ts=1676985449.906609&amp;cid=C0B8MA7FA could you elaborate how it could be achieved? the simplicity of the current approach is that it just works by specifying the shebang, no extra stuff is needed. I’m wondering how the API of the library would have to be changed for this to work
a
p
right, thanks! we concluded in a similar way
a
I'm not sure how feasible it is to implement. I remember we looked into it and while I think it's possible according to the docs, it would still be a lot of work
p
yep, the benefits don’t seem to outweigh the cost just yet
a
I think the IJ plugin would basically automatically add the GitHubWorkflowsKtScriptContext in Intellij
p
what about calling the
.<something>.kts
from outside of IntelliJ?
a
and then you could have
my-workflow.workflow.kts
no idea 🤷‍♀️
so the shebang at the moment is
kotlin.exe
or something, right?
that bundles the
.main.kts
scripting context
#!/usr/bin/env kotlin
a
so you'd need to make your own
gh-workflow.exe
that extends
kotlin.exe
and also bundles GitHubWorkflowsKtScriptContext
p
doesn’t sound like fun 😅
because this own executable would have to be deployed somehow
a
haha, that depends on how much free time you have
p
right now oscillating around 0 😂
a
I think it's not worth it for something that can basically be emulated by defining some function in the lib
Copy code
fun workflow(block: GitHubWorkflowsKtScriptContext.() -> Unit) {}
and then in the script, you've got the context
Copy code
workflow {
  ...
}
my point with mentioning a custom scripting context is that I think it'd be worth keeping a tally of things that need an IJ plugin, because maybe one day the scales will tip over!