This commit is contained in:
2025-01-15 11:51:44 -05:00
parent 22f37bcdee
commit fe66d7a723
+9 -4
View File
@@ -26,13 +26,18 @@ jobs:
run: |
tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
tea login default gitea-rinoa
echo "Checking if PR exists for ${{ github.ref_name }}"
tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep -q '${{ github.ref_name }}'
if [ $? -eq 0 ]; then
echo "Checking if PR exists for branch: ${{ github.ref_name }}"
PR_EXISTS=$(tea pr ls --repo "${{ github.repository }}" --state open --fields index,title,head,state --output csv | grep -c "${{ github.ref_name }}")
if [ "$PR_EXISTS" -ge 1 ]; then
echo "PR exists, skipping creation..."
elif [ $? -eq 1 ]; then
elif [ "$PR_EXISTS" -eq 0 ]; then
echo "PR does not exist, creating PR..."
tea pr c -r "${{ github.repository }}" -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}"
else
echo "Error determining PR status. Exiting..."
exit 1
fi
docker-compose-test: