From e7a97667e71faf2f91cc6f9cfd5b2a223c2b44be Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 11 Sep 2021 22:11:35 +0200 Subject: [PATCH] Fix updater logics --- .github/workflows/updater.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 323cdb2..71c3762 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -27,15 +27,17 @@ assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ echo "Current version: $current_version" echo "Latest release from upstream: $version" echo "VERSION=$version" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV # Proceed only if the retrieved version is greater than the current one if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then echo "::warning ::No new version available" - exit 1 + exit 0 # Proceed only if a PR for this new version does not already exist elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then echo "::warning ::A branch already exists for this update" - exit 1 + exit 0 fi # Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) @@ -125,5 +127,6 @@ jq -s --indent 4 ".[] | .version = \"$VERSION~ynh1\"" manifest.json | sponge man # No need to update the README, yunohost-bot takes care of it -# The Action will proceed only if a 0 exit code is returned +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV exit 0