From 4015119bf12097979dcda6bf540240a8ecca859a Mon Sep 17 00:00:00 2001 From: semeniak97mf Date: Thu, 22 Aug 2024 18:27:59 +0300 Subject: [PATCH] Check if there are new commits to sync fix 2 --- .github/workflows/sync-upstream.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml index f2acc97f56ba..36a8cbd47769 100644 --- a/.github/workflows/sync-upstream.yml +++ b/.github/workflows/sync-upstream.yml @@ -46,10 +46,10 @@ jobs: run: | if [ $(git rev-list HEAD...upstream/master --count) -ne 0 ]; then echo "New commits found" - echo "new_commits=true" >> $GITHUB_ENV + echo "::set-output name=new_commits::true" else echo "This branch is up to date" - echo "new_commits=false" >> $GITHUB_ENV + echo "::set-output name=new_commits::false" fi - name: Push changes to origin @@ -58,14 +58,14 @@ jobs: git pull upstream --ff-only git push origin upstream - - name: Check if PR already exists + - name: Push changes to origin if: steps.check_commits.outputs.new_commit == 'true' id: check_pr_exists env: GH_TOKEN: ${{ github.token }} run: | pr_count=$(gh pr list --repo ${{ github.repository }} --json 'headRefName' --jq 'map(select(.headRefName == "upstream")) | length') - echo "pr_count=${pr_count}" >> $GITHUB_ENV + echo "::set-output name=pr_count::${pr_count}" if [ "$pr_count" -gt 0 ]; then echo "Pull Request already exists."