{"id":39071653,"url":"https://github.com/davidsonbrsilva/versioning-workflow","last_synced_at":"2026-01-17T18:21:40.274Z","repository":{"id":236448760,"uuid":"790479312","full_name":"davidsonbrsilva/versioning-workflow","owner":"davidsonbrsilva","description":"Automatic code version generation tool","archived":false,"fork":false,"pushed_at":"2024-05-13T20:28:09.000Z","size":121,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-13T21:37:14.377Z","etag":null,"topics":["automatic-versioning","semantic-versioning","version-generation","versioning","versioning-workflow","workflows"],"latest_commit_sha":null,"homepage":"https://medium.com/@davidsonbrsilva/versioning-workflow-478214c19105","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidsonbrsilva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-23T00:32:15.000Z","updated_at":"2024-05-13T20:27:21.000Z","dependencies_parsed_at":"2024-05-13T21:52:08.910Z","dependency_job_id":null,"html_url":"https://github.com/davidsonbrsilva/versioning-workflow","commit_stats":null,"previous_names":["davidsonbrsilva/versioning-workflow"],"tags_count":133,"template":false,"template_full_name":null,"purl":"pkg:github/davidsonbrsilva/versioning-workflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsonbrsilva%2Fversioning-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsonbrsilva%2Fversioning-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsonbrsilva%2Fversioning-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsonbrsilva%2Fversioning-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidsonbrsilva","download_url":"https://codeload.github.com/davidsonbrsilva/versioning-workflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidsonbrsilva%2Fversioning-workflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28515333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T17:57:59.192Z","status":"ssl_error","status_checked_at":"2026-01-17T17:57:52.527Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automatic-versioning","semantic-versioning","version-generation","versioning","versioning-workflow","workflows"],"created_at":"2026-01-17T18:21:34.693Z","updated_at":"2026-01-17T18:21:40.262Z","avatar_url":"https://github.com/davidsonbrsilva.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Versioning Workflow \u003c!-- omit from toc --\u003e\n\n![GitHub Release](https://img.shields.io/github/v/release/davidsonbrsilva/versioning-workflow)\n![License](https://img.shields.io/github/license/davidsonbrsilva/versioning-workflow.svg)\n![Code Size](https://img.shields.io/github/languages/code-size/davidsonbrsilva/versioning-workflow)\n![Project Status](https://img.shields.io/badge/status-active-green.svg)\n\n[Ver em Português](README.pt.md)\n\n_Versioning Workflow_ is a tool that allows automatic versioning of your code. It is based on [_conventional commits_](https://www.conventionalcommits.org/en/v1.0.0/) and branch patterns to determine versions. The generated versions follow [semantic versioning](https://semver.org/).\n\n## Summary \u003c!-- omit from toc --\u003e\n\n- [1. Installation](#1-installation)\n- [2. Usage](#2-usage)\n  - [2.1. Release creation workflow](#21-release-creation-workflow)\n    - [2.1.1. Using a different name for the main branch](#211-using-a-different-name-for-the-main-branch)\n    - [2.1.2. The `upsert_major_version` job](#212-the-upsert_major_version-job)\n  - [2.2. Pre-release creation workflow](#22-pre-release-creation-workflow)\n    - [2.2.1. Customizing branch names to generate versions](#221-customizing-branch-names-to-generate-versions)\n    - [2.2.2. Using more than one branch name to generate versions](#222-using-more-than-one-branch-name-to-generate-versions)\n  - [2.3. Using the `v` prefix for versions](#23-using-the-v-prefix-for-versions)\n  - [2.4. Customizing the release name](#24-customizing-the-release-name)\n  - [2.5. Adding a prefix to the release name](#25-adding-a-prefix-to-the-release-name)\n- [3. Contact](#3-contact)\n- [4. License](#4-license)\n\n## 1. Installation\n\nCopy the `create-pre-release.yml` and `create-release.yml` files from the `.github/workflows` directory to a directory with the same name at the root of your project. That's it!\n\n## 2. Usage\n\nThere are two workflows available for you to use: the **release creation** and the **pre-release creation**. You can choose to use only the release creation workflow or combine it with the pre-release creation workflow.\n\n### 2.1. Release creation workflow\n\n```yml\nname: Release\n\non:\n  push:\n    branches: [\"main\"]\n\njobs:\n  create_release:\n    name: Create release\n    uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-release-template.yml@v1\n    permissions:\n      contents: write\n```\n\nThis is the most basic way to use this workflow. It will be triggered whenever changes are detected directly on the main branch, through pull requests or direct commits. New versions are generated from the commit messages in the following order of precedence:\n\n1. Commits that start with `BREAKING CHANGE:` or `\u003csome_prefix\u003e!:` (note the use of `!`) generate new major versions of the code (for example, from `0.1.0` to `1.0.0`).\n2. Commits that start with `FIRST RELEASE:` in non-public versions of the code (version `0`) generate the initial release version of the software (version `1.0.0`).\n3. Commits that start with `fix:` generate new patch versions of the code (for example, from `0.1.0` to `0.1.1`).\n4. Commits in any other pattern generate minor versions of the code (for example, from `0.1.0` to `0.2.0`).\n\n#### 2.1.1. Using a different name for the main branch\n\nBy default, `main` is considered the main branch, but you can modify this through the `main_branch` parameter:\n\n```yml\ncreate_release:\n  name: Create release\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    main_branch: \"master\"\n```\n\n#### 2.1.2. The `upsert_major_version` job\n\nIn the `create-release.yml` file template, you will notice that there is a job called `upsert_major_version`:\n\n```yml\nupsert_major_version: # Optional\n  name: Upsert major version\n  needs: create_release\n  permissions:\n    contents: write\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/upsert-major-version-template.yml@v1\n  with:\n    version: ${{ needs.create_release.outputs.version }}\n```\n\nThis job is optional and can be removed if you want. With each release version, it generates a `v[major_version]` tag (for example, `v1`) and keeps it updated, always referencing the latest version, until a new major version is released.\n\n### 2.2. Pre-release creation workflow\n\n```yml\ncreate_release_candidate:\n  name: Create release candidate\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-pre-release-template.yml@v1\n  permissions:\n    contents: write\n```\n\nThis is the most basic way to use the pre-release workflow. It will be triggered on pull request events: on opening, during new commits, and on reopening. Each new change in a pull request will generate a release candidate version (`-rc-\u003cnumber\u003e`).\n\nRelease candidate versions are incremented with each new change (for example, from `0.1.0-rc-1` to `0.1.0-rc-2`). New release candidate versions (`-rc-1`) are generated taking into account the name of the source branches and the commit pattern, in the following order of precedence:\n\n1. Commits that start with `BREAKING CHANGE:` or `\u003csome_prefix\u003e!:` will generate major versions.\n2. Commits that start with `FIRST RELEASE:` in non-public versions of the code (version `0`) will generate the initial release version of the software (version `1.0.0`).\n3. Branches that match the `feature_branches` parameter will generate minor versions of the code.\n4. Branches that match the `release_branches` parameter will also generate minor versions of the code.\n5. Branches that match the `hotfix_branches` parameter will generate patch versions of the code.\n\n\u003e If the branch does not match any of the previous patterns, the automatic pre-release version will not be generated.\n\n#### 2.2.1. Customizing branch names to generate versions\n\nJust like in the release creation workflow, you can also inform a different name for the main branch through `main_branch`. The same goes for feature, release, and hotfix branches:\n\n1. To generate minor versions, the workflow will look for branches that match the pattern of the `feature_branches` and `release_branches` parameters. If any of the parameters is not informed, the value `feature` will be considered as the default name for `feature_branches` and `release` for `release_branches`.\n2. To generate patch versions, the workflow will look for branches that match the pattern of the `hotfix_branches` parameter. If the parameter is not informed, the value `hotfix` will be considered as the default name.\n\n```yml\ncreate_release_candidate:\n  name: Create release candidate\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-pre-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    main_branch: \"main\"\n    feature_branches: \"feature\"\n    release_branches: \"release\"\n    hotfix_branches: \"hotfix\"\n```\n\n#### 2.2.2. Using more than one branch name to generate versions\n\nFinally, you can also use more than one branch name for the `feature_branches`, `release_branches`, and `hotfix_branches` parameters, if you want. For example:\n\n```yml\ncreate_release_candidate:\n  name: Create release candidate\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-pre-release-template.yml@v1\n  with:\n    feature_branches: \"feat feature\" # will accept source branch match for both 'feat' and 'feature'\n    release_branches: \"rel release\" # will accept source branch match for both 'rel' and 'release'\n    hotfix_branches: \"fix hotfix\" # will accept source branch match for both 'fix' and 'hotfix'\n```\n\n### 2.3. Using the `v` prefix for versions\n\nSome tools, like Github, suggest using versions that start with `v`, such as `v1.0.0`. You can enable this behavior using the `use_v_prefix` flag:\n\n**Release creation workflow**\n```yaml\ncreate_release:\n  name: Create release\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    use_v_prefix: true\n```\n\n**Pre-release creation workflow**\n```yaml\ncreate_release_candidate:\n  name: Create release candidate\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-pre-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    use_v_prefix: true\n```\n\n### 2.4. Customizing the release name\n\nBy default, generated release names receive the name used to generate the version. You can override this behavior using the `release_name` property:\n\n**Release creation workflow**\n```yaml\ncreate_release:\n  name: Create release\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    release_name: \"My Amazing Release\"\n```\n\n**Pre-release creation workflow**\n```yaml\ncreate_release_candidate:\n  name: Create release candidate\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-pre-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    release_name: \"My Amazing Release\"\n```\n\nWith this property, all created releases will receive the name \"My Amazing Release\" instead of the version name.\n\n### 2.5. Adding a prefix to the release name\n\nYou can also define a prefix to be adopted in the release name. This is useful in cases where you still want to keep the generated version in the release name but want to add a prefix of your choice. This can be achieved through the `release_name_prefix` property:\n\n**Release creation workflow**\n```yaml\ncreate_release:\n  name: Create release\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    release_name_prefix: \"Github\"\n```\n\n**Pre-release creation workflow**\n```yaml\ncreate_release_candidate:\n  name: Create release candidate\n  uses: davidsonbrsilva/versioning-workflow/.github/workflows/create-pre-release-template.yml@v1\n  permissions:\n    contents: write\n  with:\n    release_name_prefix: \"Github\"\n```\n\nIn this example, the created releases will follow the pattern \"Github 1.0.0\".\n\n## 3. Contact\n\nFor questions or suggestions, send an email to \u003cdavidsonbruno@outlook.com\u003e.\n\n## 4. License\n\nMIT Copyright (c) 2024 Davidson Bruno\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidsonbrsilva%2Fversioning-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidsonbrsilva%2Fversioning-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidsonbrsilva%2Fversioning-workflow/lists"}