Title: Promote PR bump preview to a reusable workflow in setup-cz · Issue #1959 · commitizen-tools/commitizen · GitHub
Open Graph Title: Promote PR bump preview to a reusable workflow in setup-cz · Issue #1959 · commitizen-tools/commitizen
X Title: Promote PR bump preview to a reusable workflow in setup-cz · Issue #1959 · commitizen-tools/commitizen
Description: Description Following the rollout of the PR bump preview pattern across three repos (#1510), the workflow is currently duplicated in three places: commitizen-tools/commitizen/.github/workflows/pr-bump-preview.yml commitizen-tools/commiti...
Open Graph Description: Description Following the rollout of the PR bump preview pattern across three repos (#1510), the workflow is currently duplicated in three places: commitizen-tools/commitizen/.github/workflows/pr-b...
X Description: Description Following the rollout of the PR bump preview pattern across three repos (#1510), the workflow is currently duplicated in three places: commitizen-tools/commitizen/.github/workflows/pr-b...
Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/1959
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Promote PR bump preview to a reusable workflow in setup-cz","articleBody":"### Description\n\nFollowing the rollout of the PR bump preview pattern across three repos (#1510), the workflow is currently duplicated in three places:\n\n- `commitizen-tools/commitizen/.github/workflows/pr-bump-preview.yml`\n- `commitizen-tools/commitizen-action/.github/workflows/pr-bump-preview.yml`\n- `commitizen-tools/setup-cz/examples/pr-bump-preview.yaml` (copy-paste source for end users)\n\nThe recent security fix (same-repo guard + `persist-credentials: false`) had to be applied to all three copies independently. Future maintenance — new `actions/checkout` versions, comment-action upgrades, additional flags — will incur the same per-repo cost.\n\n### Possible Solution\n\nPromote the example into a **reusable workflow** hosted in `commitizen-tools/setup-cz`.\n\n**Files**\n\n1. New `setup-cz/.github/workflows/pr-bump-preview.yml` with `on: workflow_call` and inputs:\n - `cz-version` (default `latest`) → forwarded to `setup-cz`\n - `extra-requirements` (default empty) → forwarded to `setup-cz`\n - `ref` (optional) → checkout ref override\n2. `examples/pr-bump-preview-wrapper.yaml` shrinks to a thin wrapper showing `uses: commitizen-tools/setup-cz/.github/workflows/pr-bump-preview.yml@v1`.\n\n**Consumer wrapper (~8 lines)**\n\n```yaml\non:\n pull_request_target:\n types: [opened, reopened, synchronize, ready_for_review]\npermissions: { contents: read, pull-requests: write }\njobs:\n preview:\n uses: commitizen-tools/setup-cz/.github/workflows/pr-bump-preview.yml@v1\n```\n\n**Migration**\n\nAfter this lands and a setup-cz release is cut:\n\n- This repo: replace the 80-line workflow with the 8-line wrapper.\n- `commitizen-tools/commitizen-action`: same.\n\n**Why a reusable workflow (not a composite action)?**\n\nA composite action would still need every consumer to write the `pull_request_target` trigger, the same-repo guard, the checkout, and the comment-posting step. Those are the exact bits we want to deduplicate. Reusable workflows encapsulate the whole job.\n\n**Why now wasn't the right time**\n\nDoing this in the original three PRs was rejected to avoid cross-repo merge coordination and to gather data on what inputs actually matter. Once the workflow has run on a few real PRs, we'll know whether `working-directory`, `cz-version` overrides, etc. are actually needed before committing them to a public reusable-workflow contract.\n\n### Additional context\n\nMirrors `commitizen-tools/setup-cz#20` so this work item is also tracked here for visibility alongside the original feature request.\n\nAcceptance:\n\n- [ ] Reusable workflow at `setup-cz/.github/workflows/pr-bump-preview.yml`\n- [ ] Trimmed example at `examples/pr-bump-preview-wrapper.yaml`\n- [ ] Tag a setup-cz release containing the new workflow\n- [ ] Follow-up PR here swapping the workflow for the wrapper\n- [ ] Follow-up PR in `commitizen-tools/commitizen-action` swapping the workflow for the wrapper\n\n### Related issues\n\n- Implements deduplication of work delivered in #1957 (this repo), commitizen-tools/commitizen-action#102, commitizen-tools/setup-cz#19\n- Original feature request: #1510\n- Cross-org tracker: commitizen-tools/setup-cz#20\r\n","author":{"url":"https://github.com/bearomorphism","@type":"Person","name":"bearomorphism"},"datePublished":"2026-05-09T08:59:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1959/commitizen/issues/1959"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:23c3cef0-ca12-2f17-3d12-065d4028ee4e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C864:F33D5:5DCA2B:7D19BA:6A4DA6FF |
| html-safe-nonce | f2b9d29d27c1b51419adaa92b3dbc89014dc7363f1063274e632c7cff29550c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODY0OkYzM0Q1OjVEQ0EyQjo3RDE5QkE6NkE0REE2RkYiLCJ2aXNpdG9yX2lkIjoiNzI3NjU0MDQyNzk1OTY0MTg1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 05ff48dc088a248a8396735a6e6b240970e3280ecffc5e2e5e2b7a334ced3e61 |
| hovercard-subject-tag | issue:4411927457 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/1959/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c7ec2b57cf2893c44fe9e5ea9eecdeb35187f048890d2941a7bc2d913d2f926e/commitizen-tools/commitizen/issues/1959 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c7ec2b57cf2893c44fe9e5ea9eecdeb35187f048890d2941a7bc2d913d2f926e/commitizen-tools/commitizen/issues/1959 |
| og:image:alt | Description Following the rollout of the PR bump preview pattern across three repos (#1510), the workflow is currently duplicated in three places: commitizen-tools/commitizen/.github/workflows/pr-b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bearomorphism |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 47723578ce6819210724ef064c858fce6d3115a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width