Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Environment variables can only be defined on steps, they can't be defined at a job level. So the same code has to be repeated in each step.

I haven't been able to play with Actions to confirm what I'm about to say, but if they use a fully compliant YAML parser you can use YAML anchors to do "copy-paste" without the copy paste; I think GitLab actually fully recommended such an approach before they supported `extends:` in their pipeline document

I'm on my phone or I would link to the YAML spec and GitLab examples in their docs for the gory details



Looks like YAML anchors and aliases are not currently supported. https://github.community/t5/GitHub-Actions/Support-for-YAML-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: