From e8ed04738866851cb0f512e9d07d99a2fb96f44a Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 9 Jul 2025 12:46:43 +0530 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=84=20chore:=20streamline=20submod?= =?UTF-8?q?ule=20update=20process=20and=20automate=20PR=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/merging-pr.yml | 70 ++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/.github/workflows/merging-pr.yml b/.github/workflows/merging-pr.yml index f091baf0ec..96aadebce0 100644 --- a/.github/workflows/merging-pr.yml +++ b/.github/workflows/merging-pr.yml @@ -38,38 +38,54 @@ jobs: GH_TOKEN: ${{ secrets.TOKEN_PR }} - update-submodule-sha: - needs: merge-submodules - if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' - runs-on: ubuntu-latest +update-submodule-sha: + needs: merge-submodules + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' + runs-on: ubuntu-latest - steps: - - name: Checkout base repo - uses: actions/checkout@v4 - with: - repository: ToolJet/ToolJet - token: ${{ secrets.TOKEN_PR }} - ref: main - submodules: recursive + steps: + - name: Checkout base repo + uses: actions/checkout@v4 + with: + token: ${{ secrets.TOKEN_PR }} + ref: main + submodules: recursive - - name: Update submodules to latest main - run: | - git config user.name "adishM98 Bot" - git config user.email "adish.madhu@gmail.com" + - name: Update submodules to latest main + run: | + git config user.name "adishM98 Bot" + git config user.email "adish.madhu@gmail.com" - git submodule update --remote frontend/ee - git submodule update --remote server/ee + git submodule update --remote frontend/ee + git submodule update --remote server/ee - git add frontend/ee server/ee + git add frontend/ee server/ee - if git diff --cached --quiet; then - echo "No submodule updates found." - else - git commit -m "🔄 chore: update submodules to latest main after auto-merge" - git push origin main - fi - env: - GH_TOKEN: ${{ secrets.TOKEN_PR }} + if git diff --cached --quiet; then + echo "No submodule updates found." && exit 0 + fi + env: + GH_TOKEN: ${{ secrets.TOKEN_PR }} + + - name: Create PR for submodule update + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.TOKEN_PR }} + commit-message: "🔄 chore: update submodules to latest main after auto-merge" + title: "🔄 chore: update submodules" + body: "Auto-generated PR to update submodules after base PR merge" + branch: auto/update-submodules-${{ github.run_id }} + base: main + + - name: Auto-merge PR + if: steps.cpr.outputs.pull-request-number != '' + run: | + echo "Merging submodule update PR #${PR_NUMBER}" + gh pr merge --squash --admin "$PR_NUMBER" --repo ToolJet/ToolJet + env: + GH_TOKEN: ${{ secrets.TOKEN_PR }} + PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} check-submodule-prs: if: github.event.action == 'labeled' && github.event.label.name == 'ready-to-merge' From b2a582b1c8dfc86074e089dc99c7311b06eb620f Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 9 Jul 2025 14:19:35 +0530 Subject: [PATCH 2/3] update submodule handling in merging PR workflow --- .github/workflows/merging-pr.yml | 82 ++++++++++++++++---------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/merging-pr.yml b/.github/workflows/merging-pr.yml index 96aadebce0..231a4189ef 100644 --- a/.github/workflows/merging-pr.yml +++ b/.github/workflows/merging-pr.yml @@ -38,54 +38,54 @@ jobs: GH_TOKEN: ${{ secrets.TOKEN_PR }} -update-submodule-sha: - needs: merge-submodules - if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' - runs-on: ubuntu-latest + update-submodule-sha: + needs: merge-submodules + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' + runs-on: ubuntu-latest - steps: - - name: Checkout base repo - uses: actions/checkout@v4 - with: - token: ${{ secrets.TOKEN_PR }} - ref: main - submodules: recursive + steps: + - name: Checkout base repo + uses: actions/checkout@v4 + with: + token: ${{ secrets.TOKEN_PR }} + ref: main + submodules: recursive - - name: Update submodules to latest main - run: | - git config user.name "adishM98 Bot" - git config user.email "adish.madhu@gmail.com" + - name: Update submodules to latest main + run: | + git config user.name "adishM98 Bot" + git config user.email "adish.madhu@gmail.com" - git submodule update --remote frontend/ee - git submodule update --remote server/ee + git submodule update --remote frontend/ee + git submodule update --remote server/ee - git add frontend/ee server/ee + git add frontend/ee server/ee - if git diff --cached --quiet; then - echo "No submodule updates found." && exit 0 - fi - env: - GH_TOKEN: ${{ secrets.TOKEN_PR }} + if git diff --cached --quiet; then + echo "No submodule updates found." && exit 0 + fi + env: + GH_TOKEN: ${{ secrets.TOKEN_PR }} - - name: Create PR for submodule update - id: cpr - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.TOKEN_PR }} - commit-message: "🔄 chore: update submodules to latest main after auto-merge" - title: "🔄 chore: update submodules" - body: "Auto-generated PR to update submodules after base PR merge" - branch: auto/update-submodules-${{ github.run_id }} - base: main + - name: Create PR for submodule update + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.TOKEN_PR }} + commit-message: "🔄 chore: update submodules to latest main after auto-merge" + title: "🔄 chore: update submodules" + body: "Auto-generated PR to update submodules after base PR merge" + branch: auto/update-submodules-${{ github.run_id }} + base: main - - name: Auto-merge PR - if: steps.cpr.outputs.pull-request-number != '' - run: | - echo "Merging submodule update PR #${PR_NUMBER}" - gh pr merge --squash --admin "$PR_NUMBER" --repo ToolJet/ToolJet - env: - GH_TOKEN: ${{ secrets.TOKEN_PR }} - PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} + - name: Auto-merge PR + if: steps.cpr.outputs.pull-request-number != '' + run: | + echo "Merging submodule update PR #${PR_NUMBER}" + gh pr merge --squash --admin "$PR_NUMBER" --repo ToolJet/ToolJet + env: + GH_TOKEN: ${{ secrets.TOKEN_PR }} + PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} check-submodule-prs: if: github.event.action == 'labeled' && github.event.label.name == 'ready-to-merge' From f23c4ecbe1ce85a675ebf449ef1d5bd3ad214bfb Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 9 Jul 2025 15:28:57 +0530 Subject: [PATCH 3/3] Update display image --- .github/workflows/merging-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merging-pr.yml b/.github/workflows/merging-pr.yml index 231a4189ef..63c76b46a3 100644 --- a/.github/workflows/merging-pr.yml +++ b/.github/workflows/merging-pr.yml @@ -72,8 +72,8 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.TOKEN_PR }} - commit-message: "🔄 chore: update submodules to latest main after auto-merge" - title: "🔄 chore: update submodules" + commit-message: "🚀 chore: update submodules to latest main after auto-merge" + title: "🚀 chore: update submodules" body: "Auto-generated PR to update submodules after base PR merge" branch: auto/update-submodules-${{ github.run_id }} base: main