mirror of
https://github.com/peter-evans/dockerhub-description.git
synced 2024-11-21 19:49:32 +01:00
Check if file size exceeds the max allowed
This commit is contained in:
parent
abea83050d
commit
84d38211e2
1 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,12 @@ IFS=$'\n\t'
|
|||
# Set the default path to README.md
|
||||
README_FILEPATH=${README_FILEPATH:="./README.md"}
|
||||
|
||||
# Check the file size
|
||||
if [ $(wc -c <${README_FILEPATH}) -gt 25000 ]; then
|
||||
echo "File size exceeds the maximum allowed 25000 bytes"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Acquire a token for the Docker Hub API
|
||||
echo "Acquiring token"
|
||||
LOGIN_PAYLOAD="{\"username\": \"${DOCKERHUB_USERNAME}\", \"password\": \"${DOCKERHUB_PASSWORD}\"}"
|
||||
|
|
Loading…
Reference in a new issue