So much for reusability... sigh. If it works, it works.
This commit is contained in:
@@ -22,37 +22,25 @@ jobs:
|
|||||||
# Step 1: Check for an existing PR
|
# Step 1: Check for an existing PR
|
||||||
- name: Check if PR Exists
|
- name: Check if PR Exists
|
||||||
id: check-pr
|
id: check-pr
|
||||||
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: Format of gocurl response.
|
|
||||||
id: format-response
|
|
||||||
run: |
|
run: |
|
||||||
RESPONSE='${{ toJSON(steps.check-pr.outputs.response) }}'
|
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 "$RESPONSE" | jq > valid_response.json
|
echo "pr_http_status=$pr_http_status" >> $GITHUB_OUTPUT
|
||||||
echo "response_json=$(cat valid_response.json)" >> $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: Parse PR Response
|
Step 2: Create PR if none exists
|
||||||
id: parse-pr
|
- name: Create PR in Gitea
|
||||||
uses: yakubique/json-utils@v1.8
|
if: ${{ steps.check_pr.outputs.pr_http_status == '404' }}
|
||||||
|
id: create-pr
|
||||||
|
uses: arifer612/Gitea-PR-action@v1.2.0
|
||||||
with:
|
with:
|
||||||
input: '${{ steps.format-response.outputs.response_json }}'
|
url: ${{ vars.RINOA_GITEA_URL }}
|
||||||
action: "get"
|
token: ${{ secrets.GITEA_API_TOKEN }}
|
||||||
key: "status"
|
|
||||||
|
|
||||||
# Step 2: Create PR if none exists
|
|
||||||
# - name: Create PR in Gitea
|
|
||||||
# if: ${{ steps.parse-pr.outputs.status == '404' }}
|
|
||||||
# id: create-pr
|
|
||||||
# uses: arifer612/Gitea-PR-action@v1.2.0
|
|
||||||
# with:
|
|
||||||
# url: ${{ vars.RINOA_GITEA_URL }}
|
|
||||||
# token: ${{ secrets.GITEA_API_TOKEN }}"
|
|
||||||
|
|
||||||
# # Job 2: Run SonarQube Analysis
|
# # Job 2: Run SonarQube Analysis
|
||||||
# sonarqube-analysis:
|
# sonarqube-analysis:
|
||||||
|
|||||||
Reference in New Issue
Block a user