mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-27 22:49:17 +01:00
Add path argument to verify-cache-files.sh
This commit is contained in:
parent
64f8769515
commit
272268544c
1 changed files with 8 additions and 2 deletions
|
@ -7,6 +7,12 @@ if [ -z "$prefix" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
path="$2"
|
||||||
|
if [ -z "$path" ]; then
|
||||||
|
echo "Must specify path argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Sanity check GITHUB_RUN_ID defined
|
# Sanity check GITHUB_RUN_ID defined
|
||||||
if [ -z "$GITHUB_RUN_ID" ]; then
|
if [ -z "$GITHUB_RUN_ID" ]; then
|
||||||
echo "GITHUB_RUN_ID not defined"
|
echo "GITHUB_RUN_ID not defined"
|
||||||
|
@ -14,7 +20,7 @@ if [ -z "$GITHUB_RUN_ID" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify file exists
|
# Verify file exists
|
||||||
file="test-cache/test-file.txt"
|
file="$path/test-file.txt"
|
||||||
echo "Checking for $file"
|
echo "Checking for $file"
|
||||||
if [ ! -e $file ]; then
|
if [ ! -e $file ]; then
|
||||||
echo "File does not exist"
|
echo "File does not exist"
|
||||||
|
@ -27,4 +33,4 @@ echo "File content:\n$content"
|
||||||
if [ -z "$(echo $content | grep --fixed-strings "$prefix $GITHUB_RUN_ID")" ]; then
|
if [ -z "$(echo $content | grep --fixed-strings "$prefix $GITHUB_RUN_ID")" ]; then
|
||||||
echo "Unexpected file content"
|
echo "Unexpected file content"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue