test_dep_update: exit gracefully if no pending PRs
This commit is contained in:
6
.github/workflows/test_dep_update.sh
vendored
6
.github/workflows/test_dep_update.sh
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user