From f3f646e6ff620c1b688d3c4acc0c407bcff98bda Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sat, 4 Oct 2025 15:33:08 -0400 Subject: [PATCH] PR Creation/Check action. --- .../gitea_tar-valon_ansible_deploy.yml | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/gitea_tar-valon_ansible_deploy.yml b/.gitea/workflows/gitea_tar-valon_ansible_deploy.yml index 3557c60..3971d73 100644 --- a/.gitea/workflows/gitea_tar-valon_ansible_deploy.yml +++ b/.gitea/workflows/gitea_tar-valon_ansible_deploy.yml @@ -37,13 +37,6 @@ jobs: with: fetch-depth: 1 - - name: Install tea CLI - uses: supplypike/setup-bin@8e3f88b4f143d9b5c3497f0fc12d45c83c123787 # v4.0.1 - with: - uri: "https://gitea.com/gitea/tea/releases/download/v${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64" - name: "tea" - version: ${{ env.TEA_VERSION }} - - name: Gotify Notification uses: eikendev/gotify-action@master with: @@ -52,21 +45,13 @@ jobs: notification_title: "GITEA: PR Check @ Tar Valon" notification_message: "Checking for existing PR... 🔍" - - name: Check if open PR exists - id: check-opened-pr-step - continue-on-error: true - run: | - tea login add --name gitea-rinoa --url "${{ secrets.TREZ_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - pr_exists=$(tea pr list --repo ${{ github.repository }} --state open --fields index,title,head | egrep '\[ANSIBLE\].*${{ github.ref_name }}' | tail -1 | wc -l) - echo "exists=$pr_exists" >> $GITHUB_OUTPUT - - - name: Create PR - if: ${{ steps.check-opened-pr-step.outputs.exists == '0' }} - run: | - tea login default gitea-rinoa - pr_index_old=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head --output csv | sed -e 's|"||g' | egrep '^[0-9]' | head -1 | awk -F"," '{print $1}') - pr_index_new=$(expr ${pr_index_old} + 1) - tea pr c -r ${{ github.repository }} -t "[ANSIBLE] Automated PR for ${{ github.ref_name }} - #${pr_index_new}" -d "Automatically created PR for branch: ${{ github.ref_name }}" -a ${{ github.actor }} -L "Ansible Configs.j2" + - name: PR Check/Creation + uses: https://git.trez.wtf/Trez/gitea-auto-pr@main + with: + url: ${{ secrets.TREZ_GITEA_URL }} + token: ${{ secrets.BOT_GITEA_TOKEN }} + pr-label: tar-valon-ansible,manual + assignee: ${{ github.actor }} - name: Gotify Notification uses: eikendev/gotify-action@master @@ -74,7 +59,7 @@ jobs: gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}" gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}" notification_title: "GITEA: PR Check @ Tar Valon" - notification_message: "PR Created 🎟️" + notification_message: "PR Check done 🎟️" ansible-dry-run: name: Ansible Dry Run