I’ve seen a few projects in the wild putting the code for part of a CI action in a shell script, rather than putting it inline in the yaml for the action. On the pro side that makes it much more testable outside a github action, on the con side it’s a layer of indirection and one more thing to support.
Does anyone have strong feelings about not doing it, before I dive in and pull out some of the optional run blocks into a separate shell script?
I actually think moving script logic out of the CI YAML files is a good idea. I remember when I was learning GitLab CI there were a number of arguments and articles that I found compelling on that front. Ultimately, the strongest argument for me was the testing argument that @Sdowney mentioned.
The script that’s embedded in the yaml is sh or bash now, so it wouldn’t be a regression. I have no objection to python of course. But I think it’s changing from one very technically difficult to run locally implementation for one that is possible for more people?
I seem to recall @dsankel being much against doing this since the ‘no access to the internet’ installs will not be able to use. But again, if the context here is github workflows I think that doesn’t apply because these aren’t run by hand but only in a github pipeline, right?
My take is… I think 90% of CI scripts should not be so long that they need to be in a separate file. If it’s give or take <10 lines, the indirection is not worth it.
GitHub actions are not testable without just triggering the workflow manually or spamming commit at another branch.