{"id":21491639,"url":"https://github.com/grumpy-programmer/conventional-commits-semver-release","last_synced_at":"2025-07-13T19:07:52.393Z","repository":{"id":37085405,"uuid":"485391110","full_name":"grumpy-programmer/conventional-commits-semver-release","owner":"grumpy-programmer","description":"GitHub Action for semantic versioning releases using conventional commits","archived":false,"fork":false,"pushed_at":"2023-03-06T15:12:54.000Z","size":602,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T08:02:47.089Z","etag":null,"topics":["actions","conventional-commits","github","github-actions","release","release-automation","semver","version"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/grumpy-programmer.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":"2022-04-25T13:50:35.000Z","updated_at":"2025-02-28T04:12:37.000Z","dependencies_parsed_at":"2024-11-17T15:35:28.919Z","dependency_job_id":"ae44eda5-59a9-4cdb-936f-b7256d704abe","html_url":"https://github.com/grumpy-programmer/conventional-commits-semver-release","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":0.4181818181818182,"last_synced_commit":"17e2ceede3b7c269a82b690d9ff9a1a691e648d2"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/grumpy-programmer/conventional-commits-semver-release","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grumpy-programmer%2Fconventional-commits-semver-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grumpy-programmer%2Fconventional-commits-semver-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grumpy-programmer%2Fconventional-commits-semver-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grumpy-programmer%2Fconventional-commits-semver-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grumpy-programmer","download_url":"https://codeload.github.com/grumpy-programmer/conventional-commits-semver-release/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grumpy-programmer%2Fconventional-commits-semver-release/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265191171,"owners_count":23725275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actions","conventional-commits","github","github-actions","release","release-automation","semver","version"],"created_at":"2024-11-23T15:17:13.905Z","updated_at":"2025-07-13T19:07:51.862Z","avatar_url":"https://github.com/grumpy-programmer.png","language":"TypeScript","readme":"# Conventional commits semver release [![main](https://github.com/grumpy-programmer/conventional-commits-semver-release/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/grumpy-programmer/conventional-commits-semver-release/actions/workflows/main.yml)\nGitHub Action for semantic versioning releases using conventional commits\n\nGitHub action using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)\nto [semantic versioning](https://semver.org/spec/v2.0.0.html) repository.\n\n**Features:**\n\n- detects version increment by commit message keywords: `fix:` to increase path version, `feat:` to increase minor and `!`\n  or `BREAKING CHANGE` to increment major,\n- exposes `tag`, `version` and `released` output useful for docker image or package versioning,\n- after detection version increase creates GitHub release and gives the option to upload files as release assets.\n\n## Conventional commits\n\nConventional commits allow project versioning using keywords in the commit message.\n\nThe standard defines two specific keywords which presence in the commit message causes the version to increase: `fix` will increase path\nand `feat:` minor version number. Increasing the major number is done by adding `!` to any keyword e.g. `refactor!:` or\nadding `BREAKING CHANGE` to the commit message.\n\nThe standard does not limit keywords apart from `fix:` and `feat:`, the following are common: `build:`, `chore:`, `ci:`, `docs:`, `style:`\n, `refactor:`, `perf:`, `test:`.\n\nApart from the simple form of the keyword e.g. `refactor:`, it is possible to add the component affected by the change\ne.g. `refactor(payment):` where payment is the component name.\n\nFor more information visit [conventional commits documentation](https://www.conventionalcommits.org/en/v1.0.0/).\n\n## Action by example\n\nLet's assume we have a project written in golang, and we want to version it.\n\nBefore adding `conventional-commits-semver-release`, the action looks like this:\n\n```yaml\nname: main\non:\n  push:\n    branches:\n      - main\n\njobs:\n  build:\n    runs-on: ubuntu-20.04\n    steps:\n      - name: checkout code\n        uses: actions/checkout@v2\n\n      - name: docker login\n        uses: docker/login-action@v1\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: set up go 1.x\n        uses: actions/setup-go@v2\n        with:\n          go-version: ^1.16\n\n      - name: cache\n        uses: actions/cache@v2\n        with:\n          path: ~/go/pkg/mod\n          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}\n          restore-keys: |\n            ${{ runner.os }}-go-\n\n      - name: build\n        run: make build\n\n      - name: docker build\n        run: docker build -t my-repository/my-image\n\n      - name: docker push\n        run: |\n          docker push my-repository/my-image\n```\n\n### Creating release\n\nSimple usage of `conventional-commits-semver-release` only for create releases:\n\n```yaml\n      # ...\n      - name: cache\n        uses: actions/cache@v2\n        with:\n          path: ~/go/pkg/mod\n          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}\n          restore-keys: |\n            ${{ runner.os }}-go-\n\n      - name: semver\n        uses: grumpy-programmer/conventional-commits-semver-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # token is mandatory to create the release\n\n      - name: build\n        run: make build\n\n      - name: docker build\n        run: docker build -t my-repository/my-image\n\n      - name: docker push\n        run: |\n          docker push my-repository/my-image\n```\n\n### Push new image only on the new version\n\nMaking the step execution dependent on the new version release:\n\n```yaml\n      # ...\n      - name: semver\n        id: semver # required to use the output in other steps\n        uses: grumpy-programmer/conventional-commits-semver-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: build\n        run: make build\n\n      - name: docker build\n        run: docker build -t my-repository/my-image\n\n      - name: docker push\n        if: ${{ steps.semver.outputs.released == 'true' }}\n        run: |\n          docker push my-repository/my-image\n```\n\n### Using version\n\nVersion output from `conventional-commits-semver-release` could be used to add the version as a docker image tag:\n\n```yaml\n      # ...\n      - name: semver\n        id: semver\n        uses: grumpy-programmer/conventional-commits-semver-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: build\n        run: make build\n\n      - name: docker build\n        run: docker build -t my-repository/my-image\n\n      - name: docker push\n        if: ${{ steps.semver.outputs.released == 'true' }} # check if a new version will be released\n        # docker tag command is required to add version as the image tag\n        run: |\n          docker tag my-repository/my-image my-repository/my-image:${{ steps.semver.outputs.version }} \n          docker push my-repository/my-image:${{ steps.semver.outputs.version }}\n```\n\nOutput could be set to env:\n\n```yaml\n      # ...\n      - name: docker push\n        if: ${{ steps.semver.outputs.released == 'true' }}\n        env:\n          VERSION: ${{ steps.semver.outputs.version }} # setting version as env simplify usage\n        run: |\n          docker tag my-repository/my-image my-repository/my-image:${VERSION}\n          docker push my-repository/my-image:${VERSION}\n```\n\n### Uploading assets\n\nAdding dist files as release assets:\n\n```yaml\n      # ...\n      - name: semver\n        id: semver\n        uses: grumpy-programmer/conventional-commits-semver-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          assets: dist/*\n\n      - name: build\n        run: make build\n\n      - name: dist\n        run: make dist\n\n      - name: docker build\n        run: docker build -t my-repository/my-image\n      # ...\n```\n\nMultiple assets:\n\n```yaml\n      # ...\n      - name: semver\n        id: semver\n        uses: grumpy-programmer/conventional-commits-semver-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          assets: |\n            dist/*darwin_amd64.zip\n            dist/*linux_arm64.zip\n      # ...\n```\n\nAll zip files assuming that dist has subdirectories:\n\n```yaml\n      # ...\n      - name: semver\n        id: semver\n        uses: grumpy-programmer/conventional-commits-semver-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          assets: |\n            dist/**/*.zip\n      # ...\n```\n\n## Action details\n\nThe `version` and `tag` available in the output are set when declaring the action (`main`), release, and sending assets takes place after\nsuccessful completion of all steps and detection of a new version (`post`).\n\n### Input\n\n| input        | type             | default | description                                                             |\n|--------------|------------------|---------|-------------------------------------------------------------------------|\n| init-version | string           | 0.1.0   | initial version of the project                                          |\n| tag-prefix   | string           | v       | tag prefix, useful for versioning multiple components in one repository |\n| assets       | multiline string |         | list of files to be upload as assets                                    |\n\n### Output\n\n| output         | type   | example | description                                     |\n|----------------|--------|---------|-------------------------------------------------|\n| tag            | string | v1.2.3  | tag as tag-prefix + version                     |\n| version        | string | 1.2.3   | new version or current version if not released  |\n| version-major  | string | 1       | major part of version                           |\n| version-minor  | string | 2       | minor part of version                           |\n| version-patch  | string | 3       | patch part of version                           |\n| tag-prefix     | string | v       | tag prefix the same as input                    |\n| released       | bool   | true    | true if new version was released                |\n\n\n## Releasing actions with Conventional commits semver release\nThis project is an example of how to implement releasing Github Actions. The main challenge is to commit built in the pipeline javascript code and updating major version tag.\n\nYou can check [main.yml](.github/workflows/main.yml) pipeline.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrumpy-programmer%2Fconventional-commits-semver-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrumpy-programmer%2Fconventional-commits-semver-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrumpy-programmer%2Fconventional-commits-semver-release/lists"}