{"id":19972575,"url":"https://github.com/jpb06/bump-package","last_synced_at":"2025-05-04T01:30:51.009Z","repository":{"id":43087483,"uuid":"347321282","full_name":"jpb06/bump-package","owner":"jpb06","description":"A github action bumping package version depending on related commits messages.","archived":false,"fork":false,"pushed_at":"2024-11-10T14:24:50.000Z","size":2709,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T08:50:26.643Z","etag":null,"topics":["ci-cd","effect-ts","git-tag","github-actions","semver"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpb06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-03-13T09:00:16.000Z","updated_at":"2025-03-06T20:42:36.000Z","dependencies_parsed_at":"2023-12-28T11:43:06.156Z","dependency_job_id":"a733e189-2254-4c66-9f4a-495dc0e98ddb","html_url":"https://github.com/jpb06/bump-package","commit_stats":{"total_commits":135,"total_committers":3,"mean_commits":45.0,"dds":0.3407407407407408,"last_synced_commit":"8a0609c2cf427ae5f097b7df4648001d26a090b5"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Fbump-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Fbump-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Fbump-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Fbump-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpb06","download_url":"https://codeload.github.com/jpb06/bump-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252276955,"owners_count":21722447,"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":["ci-cd","effect-ts","git-tag","github-actions","semver"],"created_at":"2024-11-13T03:08:35.679Z","updated_at":"2025-05-04T01:30:50.271Z","avatar_url":"https://github.com/jpb06.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bump-package\n\n[![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode\u0026label=\u0026message=Open%20in%20Visual%20Studio%20Code\u0026labelColor=2c2c32\u0026color=007acc\u0026logoColor=007acc)](https://github.dev/jpb06/bump-package)\n![Github workflow](https://img.shields.io/github/actions/workflow/status/jpb06/bump-package/tests-scan.yml?branch=master\u0026logo=github-actions\u0026label=last%20workflow)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=jpb06_bump-package)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=jpb06_bump-package)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=jpb06_bump-package)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=jpb06_bump-package)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=jpb06_bump-package)\n![Total coverage](./badges/coverage-total.svg)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=ncloc)](https://sonarcloud.io/summary/new_code?id=jpb06_bump-package)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=jpb06_bump-package)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=jpb06_bump-package)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=jpb06_bump-package)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=jpb06_bump-package)\n[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=jpb06_bump-package\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=jpb06_bump-package)\n![Last commit](https://img.shields.io/github/last-commit/jpb06/bump-package?logo=git)\n\nA github action bumping the version of a package and pushing the version bump to the repo.\n\n\u003c!-- readme-package-icons start --\u003e\n\n\u003cp align=\"left\"\u003e\u003ca href=\"https://docs.github.com/en/actions\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/GithubActions-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://www.typescriptlang.org/docs/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/TypeScript.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://nodejs.org/en/docs/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/NodeJS-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://bun.sh/docs\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Bun-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://biomejs.dev/guides/getting-started/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Biome-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://github.com/conventional-changelog\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/CommitLint.Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://esbuild.github.io/getting-started/#install-esbuild\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Esbuild-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://vitest.dev/guide/\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Vitest-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://www.effect.website/docs/quickstart\" target=\"_blank\"\u003e\u003cimg height=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Effect-Dark.svg\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- readme-package-icons end --\u003e\n\n## ⚡ Description\n\nThis github action bumps package.json version after a commit is pushed or a pull request is merged to the repo master branch. The updated package.json file is then pushed to master and a tag is created.\n\n### ⚠️ This action requires [the checkout action](https://github.com/actions/checkout) to work\n\n### ⚠️ You need to allow read and write operations granted to the GITHUB_TOKEN for workflows\n\n\u003e You can find the configuration option in `Settings -\u003e Actions -\u003e Workflow permissions`.\n\n### 🔶 Pushing directly to default branch\n\nIf you push directly to default branch, then only the pushed commit message will be scanned to define if a bump should be performed.\n\n### 🔶 Pull requests\n\nIn the case of a pull request, the action will adapt to the merging strategy chosen.\n\n#### 🧿 Merge commits\n\nIf the PR is merged using the merge commit strategy, then all the messages of all the commits in the branch will be scanned.\n\n#### 🧿 Squash merging\n\nIf the PR is merged using the squash merging strategy, all the commits will be squashed into one. Github typically joins the messages of all the squashed commits into the single commit that will be written to the target branch. This message typically looks like this from the squash of 3 commits:\n\n```text\nDoing cool stuff (#3)\n\n* feat: my cool feature\n\n* chore: fixing stuff\n\n* yolo\n```\n\nIn that case, this message will be scanned to define whether a bump should be performed. In this example, it would result in a minor bump with the following config:\n\n```yaml\n# [...]\n- name: ⏫ Bumping version\n  uses: jpb06/bump-package@latest\n  with:\n    major-keywords: BREAKING CHANGE\n    minor-keywords: feat,minor\n    patch-keywords: fix,chore\n```\n\n#### 🧿 Completed workflow events\n\nYou can also run the action by depending on another workflow. In that case the commits messages will be extracted from the `completed` webhook event:\n\n```yaml\n[...]\n\non:\n  workflow_run:\n    workflows: ['my-other-workflow']\n    types:\n      - completed\n\njobs:\n  version-bump:\n    name: 🆕 Version bump\n    runs-on: ubuntu-latest\n    timeout-minutes: 10\n    steps:\n      [...]\n\n      - name: ⏫ Bump package version\n        id: bumping-version\n        uses: jpb06/bump-package@latest\n```\n\n## ⚡ Inputs\n\n### 🔶 `cwd`\n\nPath location of the package to bump. Useful for monorepos.\n\n\u003e Default value: **.**\n\n### 🔶 `major-keywords`\n\nCommits messages starting with these keywords will trigger a major bump. Commas may be used to specify more than one keyword\n\n\u003e Default value: **[Major]:**\n\n### 🔶 `minor-keywords`\n\nCommits messages starting with these keywords will trigger a minor bump. Commas may be used to specify more than one keyword\n\n\u003e Default value: **[Minor]:**\n\n### 🔶 `patch-keywords`\n\nCommits messages starting with these keywords will trigger a patch bump. Commas may be used to specify more than one keyword\n\n\u003e Default value: **[Patch]:**\n\n### 🔶 `should-default-to-patch`\n\nIf no keywords are present in branch commits, bump anyway by doing a patch.\n\n\u003e Default value: **false**\n\n### 🔶 `commit-user`\n\nCustomizing the name of the user committing generated badges (optional).\n\n\u003e Default value: **\u003ccontext.actor\u003e**\n\n### 🔶 `commit-user-email`\n\nCustomizing the email of the user committing generated badges (optional).\n\n\u003e Default value: **\u003ccontext.actor\u003e@users.noreply.github.com**\n\n### 🔶 `debug`\n\nDebug mode. Will display event github event data.\n\n\u003e Default value: **false**\n\n## ⚡ Outputs\n\n### 🔶 `bump-performed`\n\n`true` if version has been bumped in package.json.\n\n### 🔶 `new-version`\n\nThe resolved new version. For example, if initial version is `1.1.1` and bump type is `patch`, then `new-version` will be `1.1.2`.\n\n## ⚡ Usage\n\n### 🔶 Using defaults\n\nIf the action runs on a commit whose message starts with either `[Major]:`, `[Minor]:` or `[Patch]:`, the version will be bumped and a tag will be created.\n\n```yaml\nname: ⚡ Package version bump\non: [push]\n\njobs:\n  bump:\n    name: 🆕 Version bump\n    runs-on: ubuntu-latest\n    steps:\n\n    - name: ⬇️ Checkout repo\n      uses: actions/checkout@v4\n\n    [...]\n\n    - name: ⏫ Bumping version\n      uses: jpb06/bump-package@latest\n```\n\n### 🔶 Using custom inputs\n\nThe action will bump the package depending on commits present in the pull request when it is merged to the master branch. By priority order:\n\n- if any commit message contains `BREAKING CHANGE`, then there will be a major bump.\n- if any commit message contains `feat` or `minor` but none of the above, then there will be a minor bump.\n- if any commit message contains `fix` or `chore` but none of the above, then there will be a patch bump.\n\nA tag will also be created by the action.\n\n```yaml\nname: ⚡ Package version bump\non: [push]\n\njobs:\n  bump:\n    name: 🆕 Version version bump\n    runs-on: ubuntu-latest\n    steps:\n\n    - name: ⬇️ Checkout repo\n      uses: actions/checkout@v4\n\n    [...]\n\n    - name: ⏫ Bumping version\n      uses: jpb06/bump-package@latest\n      with:\n        major-keywords: BREAKING CHANGE\n        minor-keywords: feat,minor\n        patch-keywords: fix,chore\n```\n\n### 🔶 Defaulting to patch bump\n\nYou may want to bump the package version even if no keywords were present in the commits list (if merging a PR) or in the last commit (if pushing to master branch).\n\nBy setting `should-default-to-patch` to `true` you can trigger this behavior. Here is an example:\n\n```yaml\nname: ⚡ Package version bump\non: [push]\njobs:\n  bump:\n    name: 🆕 Version bump\n    runs-on: ubuntu-latest\n    steps:\n\n    - name: ⬇️ Checkout repo\n      uses: actions/checkout@v4\n\n    [...]\n\n    - name: ⏫ Bumping version\n      uses: jpb06/bump-package@latest\n      with:\n        major-keywords: BREAKING CHANGE\n        minor-keywords: feat,minor\n        patch-keywords: fix,chore\n        should-default-to-patch: true\n```\n\nNow let's imagine I'm running this action when merging a PR with the following commits:\n\n- cool\n- obnoxios commit message\n- hey\n\nSince no keywords were detected, the action will bump the package version with a patch: `1.0.0` -\u003e `1.0.1`.\n\n### 🔶 Using output\n\nWe may want to perform an action if package.json has been bumped. We can use `bump-performed` output for this:\n\n```yaml\nname: ⚡ Package version bump\non: [push]\njobs:\n  bump:\n    name: 🆕 Version bump\n    runs-on: ubuntu-latest\n    steps:\n\n    - name: ⬇️ Checkout repo\n      uses: actions/checkout@v4\n\n    [...]\n\n    - name: ⏫ Bumping version\n      id: bumping-version\n      uses: jpb06/bump-package@latest\n\n    - name: 🚀 Publishing package\n      if: steps.bumping-version.outputs.bump-performed == 'true'\n      run: |\n        cd dist\n        yarn publish --non-interactive\n      env:\n        NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\nYou can also get the new version using `new-version` output:\n\n```yaml\n- name: Display action output\n  run: |\n    echo \"New version: ${{ steps.bumping-version.outputs.new-version }}\"\n```\n\n### 🔶 Monorepos\n\nYou can use the input `cwd` to perform a bump for a monorepo app or package. The following job would bump the package.json file located at `./libs/my-package/package.json`:\n\n```yaml\nname: ⚡ Package version bump\non: [push]\njobs:\n  bump:\n    name: 🆕 Version bump\n    runs-on: ubuntu-latest\n    steps:\n\n    - name: ⬇️ Checkout repo\n      uses: actions/checkout@v4\n\n    [...]\n\n    - name: ⏫ Bumping version\n      uses: jpb06/bump-package@latest\n      with:\n        cwd: ./libs/my-package\n```\n\n#### The pushed version tag will look like this: `\u003cpackage_name\u003e@v\u003cversion\u003e`\n\nExample:\n\n\u003e `my-package@v2.3.0`\n\n#### The bump commit will have the following message: `chore(\u003cpackage_name\u003e): bump version to \u003cversion\u003e`\n\nEexample:\n\n\u003e `chore(my-package): bump version to v2.3.0`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpb06%2Fbump-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpb06%2Fbump-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpb06%2Fbump-package/lists"}