Changing the check PR step.
Gitea Branch PR, SonarQube Analyze, and Merge Workflow / Check and Create PR (push) Has been cancelled
Gitea Branch PR, SonarQube Analyze, and Merge Workflow / Docker Compose Test (push) Has been cancelled
Gitea Branch PR, SonarQube Analyze, and Merge Workflow / PR Merge (push) Has been cancelled
Gitea Branch PR, SonarQube Analyze, and Merge Workflow / Check and Create PR (push) Has been cancelled
Gitea Branch PR, SonarQube Analyze, and Merge Workflow / Docker Compose Test (push) Has been cancelled
Gitea Branch PR, SonarQube Analyze, and Merge Workflow / PR Merge (push) Has been cancelled
This commit is contained in:
@@ -17,12 +17,12 @@ jobs:
|
||||
- name: PR list
|
||||
id: list-prs
|
||||
run: |
|
||||
curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea
|
||||
chmod +x /usr/local/bin/tea
|
||||
echo "Listing PRs..."
|
||||
tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
|
||||
tea pr ls --state all --fields index,state,head --output csv | head -2 | tail -1 | awk -F, '{print $2}'
|
||||
echo "PR state: $pr_state"
|
||||
pr_check=$(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_state=$(echo ${pr_check} | jq -r '.state')
|
||||
|
||||
- name: Create PR
|
||||
if: steps.list-prs.outputs.pr_state != 'open'
|
||||
|
||||
Reference in New Issue
Block a user