From 6386c9102d280e34b6f944cf893077b941c1f71a Mon Sep 17 00:00:00 2001 From: Cycle Bai <168964798+CycleBai@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:49:50 +1000 Subject: [PATCH] ci: Fix errors --- .github/workflows/auto_pr.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_pr.yml b/.github/workflows/auto_pr.yml index d6d16e2..c37b743 100644 --- a/.github/workflows/auto_pr.yml +++ b/.github/workflows/auto_pr.yml @@ -69,8 +69,15 @@ jobs: title: "Auto PR from ${{ env.branch_name }}" body: "This is an automated PR created from ${{ env.branch_name }}" - - name: Append commit to existing PR + - name: Get PR number if: env.branch_exists == 'true' + id: get_pr_number run: | pr_number=$(gh pr list --state open --head ${{ env.branch_name }} --json number -q '.[0].number') - gh pr comment ${{ pr_number }} --body "New commits have been added to the PR." + echo "pr_number=$pr_number" >> $GITHUB_ENV + echo "PR number: $pr_number" + + - name: Append commit to existing PR + if: env.branch_exists == 'true' + run: | + gh pr comment ${{ env.pr_number }} --body "New commits have been added to the PR."