diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 76d80af0..1d0303b6 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -27,8 +27,9 @@ jobs: tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} tea login default gitea-rinoa - echo "Checking if PR exists for branch: ${{ github.ref_name }}" - PR_EXISTS=$(tea pr ls --repo "${{ github.repository }}" --state open --fields index,title,head,state --output csv | grep -c "${{ github.ref_name }}") + echo "Checking if any open PRs exist for branch: ${{ github.ref_name }}" + PR_STATE=$(tea pr ls --repo "${{ github.repository }}" --state all --fields index,title,head,state --output csv | grep "${{ github.ref_name }}") | head -1 | awk -F',' '{print $4}' | tr -d '"' + PR_EXISTS=$(echo "$PR_STATE" | wc -l) if [ "$PR_EXISTS" -ge 1 ]; then echo "PR exists, skipping creation..."