Unclear what environment variables are set when saving to cache

macos

#1

I wanted to use the RUBY_VERSION as part of my cache key via {{ .Environment.RUBY_VERSION }}. As I learned this is at least for macOS machines only populated if chruby runs and this only happens when I explicitly specify to run shell scripts in a login shell. It seems like this is not happening for the save to cache step. I would expect that this would happen as I configured in my job via shell: /bin/bash --login -eo pipefail. If this is not supposed to happen, it would be nice to have documented which environment variables are available for caching.
I guess as a workaround I could use {{ checksum ".ruby-version" }}.


#2

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.