This commit is contained in:
2024-12-27 16:46:38 -05:00
parent cadb8800fd
commit 01ec446548
+3 -9
View File
@@ -21,17 +21,11 @@ jobs:
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 --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep 'open'
if [ $? -eq 0 ]; then
echo "PR already exists. Skipping PR creation."
echo "pr_state=open" >> $GITHUB_OUTPUT
else
echo "PR does not exist. Creating PR..."
echo "pr_state=closed" >> $GITHUB_OUTPUT
fi
pr_state=$(tea pr ls --state all --fields index,state,head --output csv | head -2 | tail -1 | awk -F, '{print $2}' | sed -e 's|"||g')
echo "pr_state=$(echo ${pr_state})" >> $GITHUB_OUTPUT
- name: Create PR
if: steps.list-prs.outputs.pr_state == 'closed'
if: steps.list-prs.outputs.pr_state != 'open'
uses: arifer612/Gitea-PR-action@v1.2.0
with:
url: ${{ gitea.server_url }}