Logic testing for PR creation.
This commit is contained in:
@@ -25,18 +25,25 @@ jobs:
|
|||||||
id: check-pr
|
id: check-pr
|
||||||
run: |
|
run: |
|
||||||
echo "Checking for existing PR..."
|
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}')
|
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 }}' -s | jq '{index: .number, state: .state}')
|
||||||
echo "pr_http_status=$pr_http_status" >> $GITHUB_OUTPUT
|
echo "pr_http_status=$pr_http_status" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Step 2: Create PR if none exists
|
- name: Get PR status
|
||||||
- name: Create PR in Gitea
|
id: get-pr-status
|
||||||
if: steps.check-pr.outputs.pr_http_status.state == 'closed'
|
uses: yakubique/json-utils@v1.8
|
||||||
id: create-pr
|
|
||||||
uses: arifer612/Gitea-PR-action@v1.2.0
|
|
||||||
with:
|
with:
|
||||||
url: ${{ vars.RINOA_GITEA_URL }}
|
input: ${{ steps.check-pr.outputs.pr_http_status }}
|
||||||
token: ${{ secrets.BOT_GITEA_TOKEN }}
|
action: "get"
|
||||||
assignee: ${{ github.actor }}
|
key: "state"
|
||||||
|
# Step 2: Create PR if none exists
|
||||||
|
# - name: Create PR in Gitea
|
||||||
|
# if: steps.check-pr.outputs.pr_http_status.state == 'closed'
|
||||||
|
# id: create-pr
|
||||||
|
# uses: arifer612/Gitea-PR-action@v1.2.0
|
||||||
|
# with:
|
||||||
|
# url: ${{ vars.RINOA_GITEA_URL }}
|
||||||
|
# token: ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
|
# assignee: ${{ github.actor }}
|
||||||
|
|
||||||
# # Job 2: Run SonarQube Analysis
|
# # Job 2: Run SonarQube Analysis
|
||||||
# sonarqube-analysis:
|
# sonarqube-analysis:
|
||||||
|
|||||||
Reference in New Issue
Block a user