Argh, first try to push and the consistency check ...
# github-workflows-kt
v
Argh, first try to push and the consistency check failed as the script was not executable. 🙈 😄
p
yeah, happens pretty often 🙂 I’ve been wondering if there’s a way to catch it earlier, other than some pre-commit hook. BTW, how have you managed to generate the YAML if the script is not executable? I think in some context (maybe in IntelliJ, cannot check now) the script runs anyway
v
I have an IntelliJ run configuration and a Gradle task. Both do not require it to be executable. You cannot really catch it, unless you check the status in Git, as the file can also be on Windows and there the executable state might not be as expected. It only has to be executable if you run it as executable from a *nix shell.
p
🤔 I thought about proactively asserting on the executable state from within the library (e.g. before writing to YAML), but I don’t understand what problem it creates on Windows. Sure it will start yelling too early, before the script is pushed and ran on GitHub, but better early than never right?
v
I'm not so sure. You might not be able to properly assert, as on Windows there is no real executable state. I guess it needs to stay how it is. One might also not use the consistency check or use the consistency check that does not execute the script. And when running on GitHub it clearly says what the problem is. Maybe some FAQ entry or doc-line that mentions it needs to be exeutable in Git would make sense, maybe with the command how to change that which also works on Windows.
Copy code
git update-index --chmod=+x .github/workflows/foo.main.kts
p
we could put it here: https://krzema12.github.io/github-workflows-kt/user-guide/getting_started/ where it already mentions
chmod +x
v
Makes sense, yeah. Something like "if you are on windows, do this after adding the file to Git" or something like that.