Logic testing for PR creation.
This commit is contained in:
@@ -25,17 +25,14 @@ jobs:
|
|||||||
id: check-pr
|
id: check-pr
|
||||||
run: |
|
run: |
|
||||||
echo "Checking for existing PR..."
|
echo "Checking for existing PR..."
|
||||||
curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }} -X 'GET' -H 'Accept: application/json' -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' -s | jq '{index: .number, state: .state}'
|
pr_status=$(curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }} -X 'GET' -H 'Accept: application/json' -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' -s | jq '{index: .number, state: .state}')
|
||||||
|
echo "pr_status=$pr_status" >> $GITHUB_OUTPUT
|
||||||
# - name: var test
|
|
||||||
# run: |
|
|
||||||
# echo "pr_status: ${{ steps.check-pr.outputs.pr_status }}"
|
|
||||||
|
|
||||||
- name: Get PR status
|
- name: Get PR status
|
||||||
id: get-pr-status
|
id: get-pr-status
|
||||||
uses: yakubique/json-utils@v1.8
|
uses: yakubique/json-utils@v1.8
|
||||||
with:
|
with:
|
||||||
input: '${{ steps.check-pr.outputs.pr_status }}'
|
input: ${{ steps.check-pr.outputs.pr_status }}
|
||||||
action: "get"
|
action: "get"
|
||||||
key: "state"
|
key: "state"
|
||||||
# Step 2: Create PR if none exists
|
# Step 2: Create PR if none exists
|
||||||
|
|||||||
Reference in New Issue
Block a user