{"id":15552860,"url":"https://github.com/bahmutov/stop-build","last_synced_at":"2025-07-28T04:04:07.681Z","repository":{"id":57371142,"uuid":"66124289","full_name":"bahmutov/stop-build","owner":"bahmutov","description":"Exits with non-zero code if there are modified Git files","archived":false,"fork":false,"pushed_at":"2017-06-25T14:18:21.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T15:05:19.369Z","etag":null,"topics":["ci","continuous-integration","utility"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bahmutov.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}},"created_at":"2016-08-20T02:37:14.000Z","updated_at":"2023-06-23T15:18:51.000Z","dependencies_parsed_at":"2022-09-18T22:23:18.759Z","dependency_job_id":null,"html_url":"https://github.com/bahmutov/stop-build","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bahmutov/stop-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fstop-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fstop-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fstop-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fstop-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/stop-build/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fstop-build/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267317635,"owners_count":24068481,"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-07-27T02:00:11.917Z","response_time":82,"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":["ci","continuous-integration","utility"],"created_at":"2024-10-02T14:22:44.546Z","updated_at":"2025-07-28T04:04:07.589Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stop-build\n\n\u003e Exits with non-zero code if there are modified Git files\n\n[![NPM][npm-icon] ][npm-url]\n\n[![Build status][ci-image] ][ci-url]\n[![semantic-release][semantic-image] ][semantic-url]\n[![js-standard-style][standard-image]][standard-url]\n\n## Why\n\nSometimes we commit to the Git repo files that are generated by the build\nstep, like `dist/app.js`. We expect the developer to run the `npm run build`\nbefore committing the source files, but often I forget. Setting up the\n[pre-commit](https://github.com/bahmutov/pre-git#readme) also does not help\nmuch - the check runs too late.\n\nThe CI runs `npm run build` step, but we do not often check if there are\nchanged files, which means there is a discrepancy. This tool actually checks\nand stops the build if there are changed files on CI.\n\n## Install\n\nInstall as a dev tool\n\n```\nnpm i -D stop-build\n```\n\n## Use\n\nAdd to your CI script after the build step. If the build step changes files\nthat are Git tracked, the `stop-build` command will exit with non-zero status\nbreaking the build. For example, `.travis.yml` file\n\n```yaml\nscript:\n  - npm run build\n  - $(npm bin)/stop-build\n```\n\nPrints changes and exits with code 1 if any found\n\n```sh\n⚠️ there are 2 changed files\nM package.json\nM src/index.js\n```\n\n### Small print\n\nAuthor: Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt; \u0026copy; 2016\n\n* [@bahmutov](https://twitter.com/bahmutov)\n* [glebbahmutov.com](http://glebbahmutov.com)\n* [blog](http://glebbahmutov.com/blog)\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSupport: if you find any problems with this module, email / tweet /\n[open issue](https://github.com/bahmutov/stop-build/issues) on Github\n\n## MIT License\n\nCopyright (c) 2016 Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n[npm-icon]: https://nodei.co/npm/stop-build.svg?downloads=true\n[npm-url]: https://npmjs.org/package/stop-build\n[ci-image]: https://travis-ci.org/bahmutov/stop-build.svg?branch=master\n[ci-url]: https://travis-ci.org/bahmutov/stop-build\n[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-url]: https://github.com/semantic-release/semantic-release\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[standard-url]: http://standardjs.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fstop-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Fstop-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fstop-build/lists"}