diff --git a/scripts/upload-gitea-release.sh b/scripts/upload-gitea-release.sh index 8138508..1e7de0d 100755 --- a/scripts/upload-gitea-release.sh +++ b/scripts/upload-gitea-release.sh @@ -31,8 +31,12 @@ repo="${GITEA_REPO:-Palav/dosh}" token="${GITEA_TOKEN:-}" title="${GITEA_TITLE:-$tag}" +if [ -z "$token" ] && [ -f "$HOME/.config/dosh/gitea-token" ]; then + token="$(tr -d '\r\n' <"$HOME/.config/dosh/gitea-token")" +fi + if [ -z "$token" ]; then - echo "GITEA_TOKEN is required" >&2 + echo "GITEA_TOKEN is required (or put it in ~/.config/dosh/gitea-token)" >&2 exit 2 fi