From a7a360c6dc42ece2d097448f9bfad9d25d24a192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Sun, 29 May 2022 20:09:51 +0100 Subject: [PATCH] test_dep_update: exit gracefully if no pending PRs --- .github/workflows/test_dep_update.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test_dep_update.sh b/.github/workflows/test_dep_update.sh index 2355f8e..0b1b110 100755 --- a/.github/workflows/test_dep_update.sh +++ b/.github/workflows/test_dep_update.sh @@ -7,6 +7,12 @@ git branch depupdate git checkout depupdate git reset --hard origin/master json="$(gh pr list --search "author:app/github-actions" --json headRefName,number)" +# If there's no updates then the CI action will fail without this, which is more common if we reduce the schedule from 24 hours. +if [[ $json == "[]" ]]; then + echo "No Dependency update PRs to merge" + exit +fi + echo "$json" | jq '.[] | .headRefName | @text' | xargs -L1 -- git pull origin if nix build .#checks.x86_64-linux.init-example-el; then echo "$json" | jq ".[] | .number | @text" | xargs -L1 -- gh pr merge --squash --delete-branch