From 21b0cc45794af4b22b3f5c1595d0fd3dc3c36150 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sat, 4 Oct 2025 14:33:06 -0400 Subject: [PATCH 1/3] Refactoring PR check/creation in manual PR workflow. --- .../workflows/pr-cloudflare-docker-deploy.yml | 54 ++++--------------- 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/.gitea/workflows/pr-cloudflare-docker-deploy.yml b/.gitea/workflows/pr-cloudflare-docker-deploy.yml index 8e4cf2b1..2b20e19c 100644 --- a/.gitea/workflows/pr-cloudflare-docker-deploy.yml +++ b/.gitea/workflows/pr-cloudflare-docker-deploy.yml @@ -24,13 +24,6 @@ jobs: with: fetch-depth: 1 - - name: Install tea - 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: @@ -39,43 +32,14 @@ jobs: notification_title: "GITEA: PR Check @ Rinoa" 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 '\[DOCKER\].*${{ 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 "[DOCKER] Automated PR for ${{ github.ref_name }} - #${pr_index_new}" \ - -d "Automatically created PR for branch: ${{ github.ref_name }}" \ - -a ${{ github.actor }} \ - -L "Docker Compose" + - 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 }} + tea-version: ${{ env.TEA_VERSION }} + pr-label: rinoa-docker,manual + assignee: ${{ github.actor }} - name: Gotify Notification uses: eikendev/gotify-action@master @@ -83,7 +47,7 @@ jobs: gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}" gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}" notification_title: "GITEA: PR Check @ Rinoa" - notification_message: "PR Created 🎟️" + notification_message: "PR Check done 🎟️" generate-service-list: name: Generate list of added/modified/deleted services -- 2.52.0 From 41b2e21ba9be8a19e72a9f75b581f409dc4a93c3 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sat, 4 Oct 2025 14:33:06 -0400 Subject: [PATCH 2/3] Refactoring PR check/creation in manual PR workflow. --- .../workflows/pr-cloudflare-docker-deploy.yml | 54 ++++--------------- 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/.gitea/workflows/pr-cloudflare-docker-deploy.yml b/.gitea/workflows/pr-cloudflare-docker-deploy.yml index 8e4cf2b1..2b20e19c 100644 --- a/.gitea/workflows/pr-cloudflare-docker-deploy.yml +++ b/.gitea/workflows/pr-cloudflare-docker-deploy.yml @@ -24,13 +24,6 @@ jobs: with: fetch-depth: 1 - - name: Install tea - 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: @@ -39,43 +32,14 @@ jobs: notification_title: "GITEA: PR Check @ Rinoa" 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 '\[DOCKER\].*${{ 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 "[DOCKER] Automated PR for ${{ github.ref_name }} - #${pr_index_new}" \ - -d "Automatically created PR for branch: ${{ github.ref_name }}" \ - -a ${{ github.actor }} \ - -L "Docker Compose" + - 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 }} + tea-version: ${{ env.TEA_VERSION }} + pr-label: rinoa-docker,manual + assignee: ${{ github.actor }} - name: Gotify Notification uses: eikendev/gotify-action@master @@ -83,7 +47,7 @@ jobs: gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}" gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}" notification_title: "GITEA: PR Check @ Rinoa" - notification_message: "PR Created 🎟️" + notification_message: "PR Check done 🎟️" generate-service-list: name: Generate list of added/modified/deleted services -- 2.52.0 From 4269b589a59b774e24ae65da4bdb5acd480e588e Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sat, 4 Oct 2025 14:53:37 -0400 Subject: [PATCH 3/3] Removing tea version refs. --- .gitea/workflows/pr-cloudflare-docker-deploy.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitea/workflows/pr-cloudflare-docker-deploy.yml b/.gitea/workflows/pr-cloudflare-docker-deploy.yml index 2b20e19c..65b3dec2 100644 --- a/.gitea/workflows/pr-cloudflare-docker-deploy.yml +++ b/.gitea/workflows/pr-cloudflare-docker-deploy.yml @@ -12,7 +12,6 @@ on: env: FLARECTL_VERSION: "0.116.0" HC_VAULT_VERSION: "1.20.4" - TEA_VERSION: "0.10.1" jobs: check-and-create-pr: @@ -37,7 +36,6 @@ jobs: with: url: ${{ secrets.TREZ_GITEA_URL }} token: ${{ secrets.BOT_GITEA_TOKEN }} - tea-version: ${{ env.TEA_VERSION }} pr-label: rinoa-docker,manual assignee: ${{ github.actor }} -- 2.52.0