Title: [feature] cz action to output commit sha · Issue #98 · commitizen-tools/commitizen-action · GitHub
Open Graph Title: [feature] cz action to output commit sha · Issue #98 · commitizen-tools/commitizen-action
X Title: [feature] cz action to output commit sha · Issue #98 · commitizen-tools/commitizen-action
Description: Feature: Commitizen gh action outputs the sha of the commit as an output to be used for downstream builds steps: - uses: actions/checkout@v4 with: ref: ${steps.cz.outputs.sha} Background We want to display the current build to the user i...
Open Graph Description: Feature: Commitizen gh action outputs the sha of the commit as an output to be used for downstream builds steps: - uses: actions/checkout@v4 with: ref: ${steps.cz.outputs.sha} Background We want to...
X Description: Feature: Commitizen gh action outputs the sha of the commit as an output to be used for downstream builds steps: - uses: actions/checkout@v4 with: ref: ${steps.cz.outputs.sha} Background We want to...
Opengraph URL: https://github.com/commitizen-tools/commitizen-action/issues/98
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[feature] cz action to output commit sha","articleBody":"# Feature:\n\nCommitizen gh action outputs the sha of the commit as an output to be used for downstream builds\n\n```yaml\n steps:\n - uses: actions/checkout@v4\n with:\n ref: ${steps.cz.outputs.sha}\n```\n\n# Background\n\n\n\nWe want to display the current build to the user in the UI of an api we are making with fastapi. To do this, we use the version in the `pyproject.toml`. However, Github actions does not checkout the latest commit on checkout, only the commit that triggered the gh workflow. Thus, when we add the version information before building the container, the latest commit from commitizen action is not added to the checked out code that builds the container. To solve this, we can add the following to our workflow:\n\n```yaml\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n ref: main\n```\naccording to this issue in gh checkout action https://github.com/actions/checkout/issues/439. However, this this is sub-optimal for larger codebase where someone could merge to main between the commitizen bump and the gh action checkout operation. This would result in subsequent build of the wrong codebase. Suggested solution is to output the sha in the commitizen action when a commit is made so the sha can be used for subsequent checkouts.\n\n```yaml\n steps:\n - uses: actions/checkout@v4\n with:\n ref: ${steps.cz.outputs.sha}\n```\n\n\n\n","author":{"url":"https://github.com/reinthal","@type":"Person","name":"reinthal"},"datePublished":"2025-01-27T12:34:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/98/commitizen-action/issues/98"}
| 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:43c6e7f4-b0b4-19fd-979f-4abc53dcad48 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A0F8:14B12A:2219766:2C87798:6976E69D |
| html-safe-nonce | a820e49f4bf96b56b65693bfd68f17b066e8cdbb473b162606d915011b31d55a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEY4OjE0QjEyQToyMjE5NzY2OjJDODc3OTg6Njk3NkU2OUQiLCJ2aXNpdG9yX2lkIjoiODQ5NDgxOTY2NTM3MTM5MTY0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | db7e8e79e1bef6584541bbd7f0f317c3797f91046a4181083926e9605755f842 |
| hovercard-subject-tag | issue:2812908937 |
| 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-action/98/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0bfe477e7912bd1a8a42fb17772d1c2e3c99fce11bf99edb080fa7e0701f5800/commitizen-tools/commitizen-action/issues/98 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0bfe477e7912bd1a8a42fb17772d1c2e3c99fce11bf99edb080fa7e0701f5800/commitizen-tools/commitizen-action/issues/98 |
| og:image:alt | Feature: Commitizen gh action outputs the sha of the commit as an output to be used for downstream builds steps: - uses: actions/checkout@v4 with: ref: ${steps.cz.outputs.sha} Background We want to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | reinthal |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/commitizen-tools/commitizen-action git https://github.com/commitizen-tools/commitizen-action.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 287308634 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen-action |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 287308634 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen-action |
| 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 | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width