From 61281aa679a7058ddc8be296aa6370cbfb1c253c Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:37:00 -0500 Subject: [PATCH] Tweaking PR list action. --- .gitea/workflows/deployment.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index ec726dc7..ff7f2619 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -15,19 +15,25 @@ jobs: uses: actions/checkout@v4 - name: PR list - uses: magebitcom/list-pr-action@v1.0.0 id: list-prs - with: - base: main - github-token: ${{ secrets.BOT_GITEA_TOKEN }} - state: open - + 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 "Merging PR..." + 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 open --output csv | egrep 'open' + if [ $? -eq 0 ]; then + echo "PR already exists. Skipping PR creation." + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') + echo "pr_index=${pr_index}" >> "$GITHUB_OUTPUT" + echo "list_exit=$?" >> "$GITHUB_OUTPUT" + - name: List PRs run: | echo "PR count: ${{ steps.list-prs.outputs.pullRequestNumbers }}" - name: Create PR - if: steps.list-prs.outputs.pr-count == 0 + if: steps.list-prs.outputs.list_exit != 0 uses: arifer612/Gitea-PR-action@v1.2.0 with: url: ${{ gitea.server_url }}