Protect special folders in GitHub Validation Action

This commit is contained in:
Franck Nijhof 2020-03-06 00:27:05 +01:00
parent be3a87c00a
commit 94f7faef4f
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
2 changed files with 13 additions and 0 deletions

View file

@ -28,10 +28,16 @@ while read image; do
# Extract properties into variables
filename=$(basename "${image}")
folderpath=$(dirname "${image}")
foldername=$(basename "${folderpath}")
width="${properties[0]}"
height="${properties[1]}"
type="${properties[2]}"
# Underscore folders are special cases. Instead one should symlink between integration domains
[[ "${foldername}" == _* && "${foldername}" != "_placeholder" && "${foldername}" != "_homeassistant" ]] \
&& error "${folderpath}" "Directories should not start with an underscore (_), please use the integration domain instead"
# Ensure file is actually a PNG file
[[ "${type}" != "PNG" ]] \
&& error "${image}" "Invalid file type '${type}' for file"

View file

@ -82,6 +82,13 @@ symlinking domain folders for the same icon/logos is allowed. The deployment
process at our hosting provider will unpack these symlinks to actual files
during the deployment process.
Please note, symlinks should only be created between integration domain
directories. The `_placeholder` & `_homeassistant` directories are special
cases and new directories with an underscore (`_`) should not be created.
The names of directories must always match the integration domain. Additional
directories are not allowed.
## Trademark Legal Notices
All product names, trademarks and registered trademarks in the images in this