Skip to content

Is hashFiles of actions/cache can be dynamic? #26612

Answered by Simran-B
joel asked this question in Actions
Discussion options

You must be logged in to vote

Nesting ${{ }} expressions inside of expressions is not supported. I’m also pretty sure that $GITHUB_WORKSPACE won’t work here because the value of key isn’t executed in a shell. You can try the following however:

key: ${{ runner.os }}-${{ matrix.ruby-version }}-${{ matrix.rails-version }}-test-${{ hashFiles(format('{0}/gemfiles/rails_{1}.gemfile.lock', github.workspace, matrix.rails-version)) }}

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants