From eedf20dfa404432a841cf14fb91bedf53603e652 Mon Sep 17 00:00:00 2001 From: ZoruaFox <96456728+ZoruaFox@users.noreply.github.com> Date: Fri, 12 Jan 2024 01:21:53 +0800 Subject: [PATCH] Update update-poetry.yml --- .github/workflows/update-poetry.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/update-poetry.yml b/.github/workflows/update-poetry.yml index 64edc657..3c32b641 100644 --- a/.github/workflows/update-poetry.yml +++ b/.github/workflows/update-poetry.yml @@ -13,20 +13,23 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: - fetch-depth: 0 # fetch all history for all branches and tags - - name: Checking for branch + - name: Check if update-deps branch exists id: check_branch run: | - git checkout update-deps - if [ `git branch --list update-deps` ]; then - echo "相关分支已存在,请删除update-deps分支后再执行本工作流" - echo "Branch exists." && exit 1 + echo "Checking for 'update-deps' branch..." + if git ls-remote --heads origin update-deps; then + echo "Branch 'update-deps' exists. Stopping workflow." + echo "::set-output name=branch_exists::true" else - echo "Branch does not exist. Continuing workflow." + echo "Branch 'update-deps' does not exist. Continuing workflow." + echo "::set-output name=branch_exists::false" fi + - name: Exit if branch exists + if: ${{ steps.check_branch.outputs.branch_exists == 'true' }} + run: exit 0 + update-dependencies: runs-on: ubuntu-latest needs: check-branch-exists