Permalink
Cannot retrieve contributors at this time
executable file
30 lines (26 sloc)
581 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
github-actions-cache/__tests__/verify-cache-files.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Validate args | |
prefix="$1" | |
if [ -z "$prefix" ]; then | |
echo "Must supply prefix argument" | |
exit 1 | |
fi | |
# Sanity check GITHUB_RUN_ID defined | |
if [ -z "$GITHUB_RUN_ID" ]; then | |
echo "GITHUB_RUN_ID not defined" | |
exit 1 | |
fi | |
# Verify file exists | |
file="test-cache/test-file.txt" | |
echo "Checking for $file" | |
if [ ! -e $file ]; then | |
echo "File does not exist" | |
exit 1 | |
fi | |
# Verify file content | |
content="$(cat $file)" | |
echo "File content:\n$content" | |
if [ -z "$(echo $content | grep --fixed-strings "$prefix $GITHUB_RUN_ID")" ]; then | |
echo "Unexpected file content" | |
exit 1 | |
fi |