zlacker

[return to "Automating a Software Company with GitHub Actions"]
1. duped+Rl[view] [source] 2021-08-19 15:53:54
>>marius+(OP)
I just want to be able to write all my workflow code as typescript (including the config - no YAML, for the love of god, no more YAML!) and run it locally with a debugger attached.

It's cost me hundreds to thousands of dollars to implement nontrivial workflows because of how the YAML is parsed (for example, empty strings when using a secret that has been renamed or removed) and the lack of introspection or debuggability when something goes wrong.

It's gotten to the point where new any new workflows I write are thin wrappers around a single script and I don't import any actions besides actions/checkout (even that has been bug prone, historically).

All that said, it's not like other platforms are better. But they certainly are cheaper and don't have dumb breakages when you need cross platform builds (has upload-artifact been fixed for executables on MacOS yet?)

◧◩
2. bastar+lD[view] [source] 2021-08-19 17:12:40
>>duped+Rl
When you edit an action on GitHub, the web editor has support for workflow syntax and will determine if your action is viable before committing. This is even easier if you use the new codespace shortcut (press .) on GitHub.

You might also want to take a look at act which allows you to run github actions locally, this is typically how I do actions development:

https://github.com/nektos/act

I'm curious what prevents you from writing your own actions in typescript now?

◧◩◪
3. duped+QJ[view] [source] 2021-08-19 17:43:25
>>bastar+lD
> the web editor has support for workflow syntax and will determine if your action is viable before committing.

I don't use the web editor, but more importantly it can't catch logical errors (missing required with: arguments, secrets that don't exist, environment variable names, etc).

> I'm curious what prevents you from writing your own actions in typescript now?

When I say "I want to write actions in typescript" I mean that I want to specify the entirety of my CI using a typescript program, without any YAML configuration. In particular, the jobs of a workflow themselves.

I have many jobs shared between build/test/release with slightly different triggers and configurations, but the only way to handle this in actions (especially when using imported actions) is by copying/pasting YAML. That wound up being untenable, and it's why I stripped out all action dependencies and wrote the automation to not use them such that all workflows

I've also had use cases for recursive workflows.

Act doesn't cover any of my use cases.

◧◩◪◨
4. simonw+531[view] [source] 2021-08-19 19:18:48
>>duped+QJ
Have you considered writing a code generator that lets you define actions in TypeScript and have it generate the YAML for you?
◧◩◪◨⬒
5. zzbzq+3m1[view] [source] 2021-08-19 20:56:36
>>simonw+531
This is absurd
[go to top]