From 81b81845f9161660686bf8acb5a650f664bad753 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 17 Dec 2024 11:14:20 -0500 Subject: [PATCH] Logic testing for PR creation. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 55f352a3..ab04b3a0 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -11,6 +11,7 @@ on: jobs: # Job 1: Check if PR exists and create one if the branch is new check-and-create-pr: + name: Check and Create PR runs-on: ubuntu-latest outputs: pr_created: ${{ steps.check-pr.outputs.pr_created }} @@ -25,25 +26,16 @@ jobs: 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 "pr_http_status=$pr_http_status" >> $GITHUB_OUTPUT - # uses: prasiman/gocurl@v1 - # with: - # url: ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }} - # method: "GET" - # headers: '{ "Authorization": "token ${{ secrets.GITEA_API_TOKEN }}" , "Accept": "application/json" }' - # accept: 200,201,204,404 - # log-response: true - - name: Var test - run: | - echo "pr_http_status: ${{ steps.check-pr.outputs.pr_http_status }}" # 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 == '404' id: create-pr uses: arifer612/Gitea-PR-action@v1.2.0 with: url: ${{ vars.RINOA_GITEA_URL }} - token: ${{ secrets.GITEA_API_TOKEN }} + token: ${{ secrets.BOT_GITEA_TOKEN }} + assignee: ${{ github.actor }} # # Job 2: Run SonarQube Analysis # sonarqube-analysis: