Given the following yaml:
- name: Check if cache key exists
uses: martijnhols/actions-cache/[email protected]
id: cache_exists
with:
path: .venv
key: ${{ runner.os }}-python-deps-${{ hashFiles('poetry.lock') }}
- name: Set up Python
uses: actions/setup-python@v4
if: steps.cache_exists.outputs.cache-hit != 'true'
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Restore dependency cache
uses: actions/cache@v3
if: steps.cache_exists.outputs.cache-hit != 'true'
id: deps-cache
with:
path: .venv
key: ${{ runner.os }}-python-deps-${{ hashFiles('poetry.lock') }}
I get this output:

Comparing the keys, they look identical (copy pasted manually from output):
Linux-python-deps-905d6047b1ef7816097d7c2ed5d59e9334470b45f129b2df87b40a4f33058e2a
Linux-python-deps-905d6047b1ef7816097d7c2ed5d59e9334470b45f129b2df87b40a4f33058e2a