From 2d3213fd4276f7df9b1eb0ce187080a82da27d2f Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 17 Dec 2024 11:40:47 -0500 Subject: [PATCH] Logic testing for PR creation. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index ab04b3a0..98d8bd6c 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -24,12 +24,13 @@ jobs: - name: Check if PR Exists id: check-pr run: | - pr_http_status=$(curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }} -X 'GET' -H 'accept: application/json' -H 'Authorization: ${{ secrets.BOT_GITEA_TOKEN }}' -w "%{http_code}" -s -o /dev/null) + echo "Checking for existing PR..." + pr_http_status=$(curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }} -X 'GET' -H 'Accept: application/json' -H 'Authorization: ${{ secrets.BOT_GITEA_TOKEN }}' | jq '{index: .number, state: .state}') echo "pr_http_status=$pr_http_status" >> $GITHUB_OUTPUT # Step 2: Create PR if none exists - name: Create PR in Gitea - if: steps.check_pr.outputs.pr_http_status == '404' + if: steps.check-pr.outputs.pr_http_status.state == 'closed' id: create-pr uses: arifer612/Gitea-PR-action@v1.2.0 with: