diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index a94e2767..d7226599 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -26,14 +26,12 @@ 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 }} which tea - echo "List all PRs" - tea pr ls --repo ${{ github.repository }} --state all echo "Check if PR exists for ${{ github.ref_name }}" pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $4}' | sed -e 's|"||g') - echo "PR_STATE: ${pr_state}" - if [ ${pr_state} != open ]; then + if [ ${pr_state} != 'open' ]; then + echo "PR does not exist, creating..." tea pr c -r ${{ github.repository }} -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}" - elif [ ${pr_state} = open ]; then + elif [ ${pr_state} = 'open' ]; then echo "PR already exists, skipping creation..." fi