From 8997da53d12414033d60fab1061292d391a005b6 Mon Sep 17 00:00:00 2001
From: Yu-Ting Hsiung <bear890707@gmail.com>
Date: Sun, 8 Jun 2025 18:47:57 +0800
Subject: [PATCH] feat: bump dry run github action

---
 .../workflows/pr-cz-dry-run-bump-comment.yml  | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 .github/workflows/pr-cz-dry-run-bump-comment.yml

diff --git a/.github/workflows/pr-cz-dry-run-bump-comment.yml b/.github/workflows/pr-cz-dry-run-bump-comment.yml
new file mode 100644
index 0000000..82ac300
--- /dev/null
+++ b/.github/workflows/pr-cz-dry-run-bump-comment.yml
@@ -0,0 +1,41 @@
+name: CZ Dry Run Bump on PR
+
+on:
+  pull_request:
+    types: [opened, synchronize]
+
+jobs:
+  cz_dry_run_comment:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.13"
+
+      - name: Install dependencies
+        run: |
+          pip install poetry
+          poetry install
+
+      - name: Run cz bump --dry-run
+        run: |
+          echo '## 🔍 Commitizen Dry Run Preview' > comment.md
+          echo '```' >> comment.md
+          poetry run cz bump --dry-run >> comment.md
+          echo '```' >> comment.md
+
+      - name: Comment on PR
+        uses: peter-evans/create-or-update-comment@v4
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+          issue-number: ${{ github.event.pull_request.number }}
+          body-path: comment.md
+          body-includes: "## 🔍 Commitizen Dry Run Preview"
+          edit-mode: replace