Path fix on L31 for gocurl.
This commit is contained in:
@@ -28,22 +28,35 @@ jobs:
|
|||||||
id: check-pr
|
id: check-pr
|
||||||
uses: prasiman/gocurl@v1
|
uses: prasiman/gocurl@v1
|
||||||
with:
|
with:
|
||||||
url: ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.base_ref }}/${{ github.ref_name }}
|
url: ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }}
|
||||||
method: "GET"
|
method: "GET"
|
||||||
headers: '{ "Authorization": "token ${{ secrets.GITEA_API_TOKEN }}" }'
|
headers: '{ "Authorization": "token ${{ secrets.GITEA_API_TOKEN }}" }'
|
||||||
|
accept: 200,201,204,404
|
||||||
log-response: true
|
log-response: true
|
||||||
|
|
||||||
- name: Evaluate Existing PR Status
|
- name: Convert gocurl Response to JSON
|
||||||
id: eval-pr
|
id: preprocess-response
|
||||||
run: |
|
run: |
|
||||||
echo "Checking if PR already exists..."
|
RESPONSE='${{ steps.check-pr.outputs.response }}'
|
||||||
if [ "${{ steps.check-pr.outputs.response }}" = "[]" ]; then
|
|
||||||
echo "pr_exists=false" >> $GITHUB_ENV
|
# Extract the 'data' and 'status_code' fields into JSON format
|
||||||
echo "No existing PR found for branch."
|
DATA=$(echo "$RESPONSE" | grep -oP 'data:\K[^\s]+' || echo "null")
|
||||||
else
|
STATUS_CODE=$(echo "$RESPONSE" | grep -oP 'status_code:\K[^\s]+' || echo "0")
|
||||||
echo "pr_exists=true" >> $GITHUB_ENV
|
|
||||||
echo "PR already exists. Continuing..."
|
# Create valid JSON output
|
||||||
fi
|
echo "{ \"data\": $DATA, \"status_code\": $STATUS_CODE }" > response.json
|
||||||
|
cat response.json
|
||||||
|
|
||||||
|
# Export as output
|
||||||
|
echo "response_json=$(cat response.json)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Parse PR Response
|
||||||
|
id: parse-pr
|
||||||
|
uses: yakubique/json-utils@v1.8
|
||||||
|
with:
|
||||||
|
input: ${{ steps.preprocess-response.outputs.response_json }}
|
||||||
|
action: "get"
|
||||||
|
key: ""
|
||||||
|
|
||||||
# Step 2: Create PR if none exists
|
# Step 2: Create PR if none exists
|
||||||
- name: Create PR in Gitea
|
- name: Create PR in Gitea
|
||||||
|
|||||||
Reference in New Issue
Block a user