diff --git a/git_pull/config.json b/git_pull/config.json index f55a9e2..b7c8fa7 100644 --- a/git_pull/config.json +++ b/git_pull/config.json @@ -1,6 +1,6 @@ { "name": "Git pull", - "version": "2.0", + "version": "2.1", "slug": "git_pull", "description": "Simple git pull to update the local configuration", "url": "https://home-assistant.io/addons/git_pull/", @@ -21,7 +21,7 @@ "schema": { "deployment_key": ["str"], "deployment_key_protocol": "match(rsa|dsa|ecdsa|ed25519|rsa)", - "repository": "url", + "repository": "match((?:git|ssh|https?|git@[-\\w.]+):(\/\/)?(.*?)(\\.git)(\/?|\\#[-\\d\\w._]+?))", "auto_restart": "bool", "repeat": { "active": "bool", diff --git a/git_pull/run.sh b/git_pull/run.sh index 317a739..14d859e 100644 --- a/git_pull/run.sh +++ b/git_pull/run.sh @@ -43,7 +43,7 @@ while true; do # Enable autorestart of homeassistant if [ "$AUTO_RESTART" == "true" ]; then - changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" + changed_files="$(git diff-tree -r --name-only --no-commit-id 'HEAD@{1}' HEAD)" # Files have changed & check config if [ ! -z "$changed_files" ]; then