From 61c3ac571e9c3f8290e66f790353342bb5be0696 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 8 Mar 2021 21:14:58 +0530 Subject: [PATCH] Fix libs workflow --- .github/workflows/libs.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/libs.yml b/.github/workflows/libs.yml index 964773d..6c0a60a 100644 --- a/.github/workflows/libs.yml +++ b/.github/workflows/libs.yml @@ -46,14 +46,18 @@ jobs: } git config --local user.email "$bot_user_id+github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - git add . - git commit -m "Updating lists" + if [ "$(git status --porcelain=v1 2>/dev/null | wc -l)" != "0" ]; then + git add . + git commit -m "Updating lists" + fi push_ref develop semver=$(git tag --sort=-refname | awk 'match($0, /^[0-9]+\.[0-9]+\.[0-9]+$/)' | head -n 1) rolling=$(git tag --sort=-refname | awk 'match($0, /^v[0-9]/)' | head -n 1) for branch in master releases/$rolling; do git checkout $branch - git merge --allow-unrelated-histories develop + if [ "$(git rev-parse "$branch")" != "$(git rev-parse develop)" ]; then + git merge --allow-unrelated-histories develop || true + fi push_ref "$branch" done for tag in $semver $rolling; do