Open doublep opened 1 year ago
We am hitting this in our custom action and it is causing confusion for our users.
My suggestion for Cache action authors is to:
allow_missing_archive
, like the author says, to suppress the warningworkaround: create empty directories for the cache paths if they do not exist at the end of the workflow:
- name: Ensure cache directories exist
shell: bash
run: |
# This helps avoid caching warnings even when these are not used.
if [ ! -d "${{ github.workspace }}/.build" ]; then
mkdir "${{ github.workspace }}/.build"
echo ".build directory created."
fi
I don't understand why this action doesn't just create the directory ?
I don't understand why this action doesn't just create the directory ?
because it is a bit odd to cache something that doesn't exist. In my case, it may or may not exist, so it's helpful for me to ignore this warning because it is no big deal that the directory was never made.
Situation:
actions/cache
is reused by a higher-level action that caches certain directory using it. This directory may or may not exist by the end of a workflow, and it not existing is not an error.However,
actions/cache
then prints the following in the output:While not a major concern, it still would be nice to avoid warnings in normal situations. As far as I see from the source code, there is no way to suppress this message. Can you add one so that outer action (or workflow) can decide between "such situation shouldn't happen, issue a warning" (as now) and "such situation is normal and completely possible, simply ignore it"?