{"id":16181711,"url":"https://github.com/ericclemmons/github-semantic-version","last_synced_at":"2025-08-14T00:04:55.040Z","repository":{"id":5818271,"uuid":"48759926","full_name":"ericclemmons/github-semantic-version","owner":"ericclemmons","description":"Automated semantic version releases powered by Github Issues.","archived":false,"fork":false,"pushed_at":"2022-12-06T15:30:40.000Z","size":409,"stargazers_count":21,"open_issues_count":10,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T00:03:28.726Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ericclemmons.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-29T17:50:41.000Z","updated_at":"2023-10-12T05:43:08.000Z","dependencies_parsed_at":"2023-01-11T17:01:39.731Z","dependency_job_id":null,"html_url":"https://github.com/ericclemmons/github-semantic-version","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/ericclemmons/github-semantic-version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fgithub-semantic-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fgithub-semantic-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fgithub-semantic-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fgithub-semantic-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericclemmons","download_url":"https://codeload.github.com/ericclemmons/github-semantic-version/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fgithub-semantic-version/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270336681,"owners_count":24566779,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-10T06:26:50.882Z","updated_at":"2025-08-14T00:04:54.511Z","avatar_url":"https://github.com/ericclemmons.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-semantic-version\n\n\u003e Automated semantic version releases powered by Github Issues.\n\n[![travis build](https://img.shields.io/travis/ericclemmons/github-semantic-version.svg)](https://travis-ci.org/ericclemmons/github-semantic-version)\n[![version](https://img.shields.io/npm/v/github-semantic-version.svg)](http://npm.im/github-semantic-version)\n[![downloads](https://img.shields.io/npm/dm/github-semantic-version.svg)](http://npm-stat.com/charts.html?package=github-semantic-version)\n[![MIT License](https://img.shields.io/npm/l/github-semantic-version.svg)](http://opensource.org/licenses/MIT)\n\n- - -\n\n## Getting Started\n\n### 1. Install\n\n```shell\n$ npm install --save-dev github-semantic-version\n```\n\n### 2. Add `GH_TOKEN` \u0026 `NPM_TOKEN` to CI\n\nFor example, in Travis CI's \"Settings\" tab for your project, you'll see:\n\u003e ![tokens](tokens.png)\n\nFor your `GH_TOKEN` [create one in Github](https://github.com/settings/tokens)\nwith `repo` credentials.\n\nYou can find `NPM_TOKEN` in your `~/.npmrc` file:\n\n```\n//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n```\n\nOnce these are in place, your new versions can be pushed back to Github \u0026 NPM\nwithout permissions \u0026 security issues.\n\n### 3. Create labels\n\nFrom your repo's `Issues \u003e Labels` section, add three labels representing the major, minor, and patch level changes in your repo. Ex:\n\n- \"Version: Major\"\n- \"Version: Minor\"\n- \"Version: Patch\"\n\nAdd your label definitions to a `gsv` section of `package.json`, to a `gsv.json` file, or a `.gsvrc` file in the base directory of your project.\n\n##### package.json example\n```json\n{\n  \"gsv\": {\n    \"majorLabel\": \"Version: Major\",\n    \"minorLabel\": \"Version: Minor\",\n    \"patchLabel\": \"Version: Patch\"\n  }\n}\n```\n\n##### gsv.json or .gsvrc example\n```json\n{\n  \"majorLabel\": \"Version: Major\",\n  \"minorLabel\": \"Version: Minor\",\n  \"patchLabel\": \"Version: Patch\"\n}\n```\n\n#### Non-version Labels\n\nSometimes a PR should not increment and publish a new version, for example, when updating dependencies, tests, or docs. To support\nthis, a 4th label named `internalLabel` can be used. When this label is found on a PR, it will be skipped.\n\n```json\n{\n  \"gsv\": {\n    \"majorLabel\": \"Version: Major\",\n    \"minorLabel\": \"Version: Minor\",\n    \"patchLabel\": \"Version: Patch\",\n    \"internalLabel\": \"No version: Internal\"\n  }\n}\n```\n\n### 4. Add labels to issues\n\nAdd one of your _custom defined labels_ to your open PRs:\n\nAs these get merged, `github-semantic-version` will use this to determine\nhow to bump the current version. _PRs merged without a label will be treated\nas `patch` releases._\n\n_If any un-tagged commits are pushed to `master` outside of a PR, they're\nautomatically treated as `patch` releases._\n\n### 5. Update `.travis.yml`\n\n```yaml\nsudo: false\nlanguage: node_js\ncache:\n  directories:\n    - node_modules\nnotifications:\n  email: false\nbranches:\n  except:\n    - /^v[0-9]/\ndeploy:\n  provider: script\n  script: npm run release\n  skip_cleanup: true\n  on:\n    branch: master\n```\n\n### 6. Usage\n\nAs automation related to your code and publishing to the world can sometimes be scary, `github-semantic-version` operates with an _additive functionality_ philosophy.\n\n#### Options\n\n`github-semantic-version`\n\nDisplays the usage information.\n\n`github-semantic-version --bump`\n\nUpdate the package version, no CHANGELOG, don't push to Github, don't publish to NPM.\n\n_Meant to be used in a CI environment._\n\n`github-semantic-version --init`\n\nGenerates a fresh CHANGELOG based on labeled PRs and any commits to `master` outside\nof any PR. Also calculates the package version based on those PRs and commits. Won't push to Github or publish to NPM.\n\n_Meant to be used outside of a CI environment to generate the initial CHANGELOG._\n\nThe expected workflow here is to ensure parity between the calculated version/changelog and your current repo version. Once that happens, you'll\nwant to manually commit those changes (adding github-semantic-version as a dependency, the new npm scripts to run on CI success, the CHANGELOG,\nupdated package.json, etc.) to master (or merge a labeled PR). Once CI builds successfully, these additions will be noted in the CHANGELOG (assuming\nthat you specified the `--changelog` flag in your npm scripts).\n\n`github-semantic-version --changelog`\n\nAppend the latest change to an\nexisting CHANGELOG (must have already been generated by the `--init` flag above).\n\nYou'll want to run `github-semantic-version --init` outside of CI to generate the initial CHANGELOG\nbefore enabling the `--changelog` flag.\n\n`github-semantic-version --bump --changelog`\n\nBump the version and append the latest change to the CHANGELOG.\n\n`github-semantic-version --bump --changelog --push`\n\nBump the version, append the latest change to the CHANGELOG, and push the changes to Github.\n\n`github-semantic-version --bump --changelog --push --publish`\n\nBump the version, append the latest change to the CHANGELOG, push to Github, and publish to NPM.\n\n#### Other flags\n\n`--force`\n\nThe flags `--bump` and `--changelog` are meant to be used in a CI environment. _Override this if you know what you're doing._\n\n`--dry-run`\n\nAppend this to see output of what _would_ happen without any writing to files, pushing to Github, or publishing to NPM.\n\n#### Debug\n\nPrepend `DEBUG=github-semantic-version:*` to the `github-semantic-version` command to show all debug output when running.\n\n### 7. Update `package.json`\n\n```json\n{\n  \"scripts\": {\n    \"prerelease\": \"npm run build\",\n    \"release\": \"github-semantic-version --bump --changelog --push --publish\"\n  }\n}\n```\n\n#### startVersion\n\nYou can add a `startVersion` to the `gsv` section of `package.json` (or to `gsv.json`) that will be used as the starting point to\ncalculate the package version of a repo. Ex:\n\n```json\n{\n  \"gsv\": {\n    \"startVersion\": \"2.5.0\",\n    \"majorLabel\": \"Version: Major\"\n  }\n}\n```\n\nIf you're working on a private project, you can leave out `--publish`, which\nmeans you have no need for your `NPM_TOKEN` either.\n\n#### github\n\nYou can add a `github` object to the `gsv` section of `package.json` (or to `gsv.json`),\nwhich are options that will be passed to the [Github API](https://www.npmjs.com/package/github).\n\n```json\n{\n  \"gsv\": {\n    \"github\": {\n      \"host\": \"github.my-GHE-enabled-company.com\"\n    }\n  }\n}\n```\n\n#### abortOnMissingLabel\n\nBy default, all PRs without a label will default to \"patch\". If you'd prefer to skip the PR instead of releasing, use the `abortOnMissingLabel` option.\n\n```json\n{\n  \"gsv\": {\n    \"abortOnMissingLabel\": true\n  }\n}\n```\n\n#### addReleasedLabelOnSuccess\n\nDefine the `addReleasedLabelOnSuccess` and `releasedLabel` options to add a label to a PR once it has been successfully published.\n\n```json\n{\n  \"gsv\": {\n    \"releasedLabel\": \"Released\",\n    \"addReleasedLabelOnSuccess\": true\n  }\n}\n```\n\n\u003e The `releasedLabel` defaults to \"Released\".\n\n### License\n\n\u003e MIT License 2016 © Eric Clemmons\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericclemmons%2Fgithub-semantic-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericclemmons%2Fgithub-semantic-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericclemmons%2Fgithub-semantic-version/lists"}