git_pull: delete key file first so we are not always appending (#1218)

This commit is contained in:
Allan Clark
2020-05-05 05:06:58 -07:00
committed by GitHub
parent 1b29439008
commit 9e08ede0f9
3 changed files with 6 additions and 1 deletions

View File

@@ -1,5 +1,9 @@
# Changelog
## 7.12
- Fix error of deployment_key eventually failing by overwriting the deployment_key every cycle
## 7.11
- Update Home Assistant CLI to 4.2.0

View File

@@ -1,6 +1,6 @@
{
"name": "Git pull",
"version": "7.11",
"version": "7.12",
"slug": "git_pull",
"description": "Simple git pull to update the local configuration",
"url": "https://github.com/home-assistant/hassio-addons/tree/master/git_pull",

View File

@@ -30,6 +30,7 @@ function add-ssh-key {
) > ~/.ssh/config
echo "[Info] Setup deployment_key on id_${DEPLOYMENT_KEY_PROTOCOL}"
rm -f "${HOME}/.ssh/id_${DEPLOYMENT_KEY_PROTOCOL}"
while read -r line; do
echo "$line" >> "${HOME}/.ssh/id_${DEPLOYMENT_KEY_PROTOCOL}"
done <<< "$DEPLOYMENT_KEY"