<@U0152P3VB5J> I’m wondering if you can implement ...
# github-workflows-kt
p
@Vampire I’m wondering if you can implement https://github.com/krzema12/github-workflows-kt/issues/641 - I’m curious if the guide on adding a new action is understandable and correct: https://github.com/krzema12/github-workflows-kt/blob/main/CONTRIBUTING.md#requestingadding-support-for-an-action
1
v
image.png
p
so the guide is broken!
v
It is 🙂
The example for a feature request to add action typing to the target action is using the old repository name, that's unfortunate.
p
true - we should replace it with a more fresh one (maybe yours? 😉) - but fortunately GitHub adds the redirect
The "guide" is very sparse when it comes to what to add to the
actions
directory. Maybe either add a bit more verbosity to the
CONTRIBUTING
or some readme to the
actions
directory what is posssible and what needs to be done when the action provides typings, when you need to provide yourself, what hash to put in
commit-hash.txt
, ...
p
true, makes sense 👍
looking at this action owner’s activity (last comment in July 2022, last change in November), I’m afraid we won’t have much traction with this request. But thanks anyway, IMO it’s important to be consistent with this effort of requesting typings
v
Nah, @vladimirsitnikov is quite active generally I think. The action hopefully just mature to not need too much work to do. Maybe he likes this lib so much that he also right-away adapts it for his workflows. His action is also written in Kotlin/JS like mine. 🙂
Is maybe not only the guide, but also the generator broken? I added the directories, typing file, and hash file and then invoked the Gradle task. But I get an
IndexOutOfBoundsException
. 😞
Ah, the generator is *nix-bound. It splits file path by slash, but I'm currently on a Windows box, so
Copy code
val (_, owner, name, version, file) = it.toString().split("/")
throws the IOOBE as there is only one element in the split array.
p
there may be a bug in the generator, sure
oh, so we build the project for *nix and Windows, but don’t actually run the wrapper generator for Windows 😅 should be easy to (quick)fix, perhaps using invariantSeparatorsPath or
it.toString().replace("\\", "/").split("/")
v
Yeah, got further now, until the
action.yml
of the new action should be parsed. 🙈
Ah, no not the parsing, the requesting. The code is not lenient regarding final newline character in the commit hash file. 🙈
See, he already reacted 🙂
Aaand merged 🙂
Wtf. I'm still first-time contributor 😠
Hm, the guide should also contain a step to actually build. 😄 I create the file, made the wrapper generator run and was done. I should really have tried to at least compile 😄
Argh:
p
Hmm, Kotlin Poet is buggy?
In practice we'll probably have to work around it
v
It is, I'd say. It should escape comment content properly I'd say. Actually that strange space is already a work-around by you for https://youtrack.jetbrains.com/issue/KT-52940
p
Ah, that's unfortunate... We'll have to come up with anorher workaround that works for both cases. Perhaps proper escaping, as you said. It deserves a separate bug/problem (we have such category) in our issue tracker
v
Actually in this case not having the space would have worked, as the "nested" comment is opened, then closed. If you just open it, it breaks (which you work-arounded). If you just close it, it breaks. 🙈
Ok, properly worked around the problem now I hope and it's also green on CI now.