by satyadeepk · 7y ago · 0 comments
Actually you can define global environment variables with an extra step... here is how I do it. I was quite frustrated until I worked this out!
- name: Set environment variables
shell: bash
run: |
echo '::set-env name=GOPATH::${{ runner.workspace }}'
echo '::add-path::${{ runner.workspace }}/bin'
echo '::set-env name=GO111MODULE::${{ matrix.modules }}'
echo '::set-env name=GOTAGS::${{ matrix.gotags }}'
echo '::set-env name=BUILD_FLAGS::${{ matrix.build_flags }}'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
[0] https://help.github.com/en/articles/events-that-trigger-work...