{"id":17242748,"url":"https://github.com/imcuttle/ci-run-staged","last_synced_at":"2026-05-20T07:11:30.530Z","repository":{"id":32443080,"uuid":"134048396","full_name":"imcuttle/ci-run-staged","owner":"imcuttle","description":"Run command inferred by git staged file expediently in ci.","archived":false,"fork":false,"pushed_at":"2022-04-30T01:15:09.000Z","size":103,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T02:33:59.182Z","etag":null,"topics":["ci-run","commit","git","range","staged-files"],"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/imcuttle.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}},"created_at":"2018-05-19T09:31:17.000Z","updated_at":"2022-04-30T01:14:53.000Z","dependencies_parsed_at":"2022-08-07T17:30:41.382Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/ci-run-staged","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fci-run-staged","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fci-run-staged/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fci-run-staged/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fci-run-staged/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/ci-run-staged/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245581545,"owners_count":20638996,"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-run","commit","git","range","staged-files"],"created_at":"2024-10-15T06:13:58.541Z","updated_at":"2026-05-20T07:11:30.474Z","avatar_url":"https://github.com/imcuttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ci-run-staged\n\n[![build status](https://img.shields.io/travis/imcuttle/ci-run-staged/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/ci-run-staged)\n[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/ci-run-staged.svg?style=flat-square)](https://codecov.io/github/imcuttle/ci-run-staged?branch=master)\n[![NPM version](https://img.shields.io/npm/v/ci-run-staged.svg?style=flat-square)](https://www.npmjs.com/package/ci-run-staged)\n[![NPM Downloads](https://img.shields.io/npm/dm/ci-run-staged.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/ci-run-staged)\n\nRun command inferred by git staged file expediently in ci.\n\nBe inspired by [lint-staged](https://github.com/okonet/lint-staged)\n\n## Installation and setup\n\n1. `npm install --save-dev ci-run-staged`\n2. Update your package.json like this:\n\n```diff\n{\n  \"scripts\": {\n+   \"ci-run-staged\": \"ci-run-staged\"\n  },\n+ \"ci-run-staged\": {\n+   \"added\": {\n+     \"doc/**/*.md\": [\n+       \"send email...\"\n+     ]\n+   },\n+   \"all\": {\n+     \"*\": \"cmd\"\n+   }\n+   \"deleted|Modified\": {\n+     \"*\": \"cmd\"\n+   }\n+ }\n}\n```\n\n3. Execute `npm run ci-run-staged` in your ci scripts.\n\n## Statuses\n\nSGF-Status (git status code)\n\n* Added\n* Copied\n* Deleted\n* Modified\n* Renamed\n* Type-Change [i.e. regular file, symlink, submodule, etc.]\n* Unmerged\n* Unknown\n\n## Command line\n\n```\n./node_modules/.bin/ci-run-staged commit-range # like HEAD, hashA...hashB\n```\n\nWhen do not set commit range definitely, ci-run-staged would find range like this:\n\n```\nprocess.env.COMMIT_RANGE || process.env.TRAVIS_COMMIT_RANGE || process.env.CIRCLE_COMPARE_URL\n```\n\n## Debugger\n\nCan be enabled by setting the environment variable `DEBUG` to `ci-run-staged*`.\n\n```bash\nDEBUG=ci-run-staged* ./node_modules/.bin/ci-run-staged\n```\n\n## FAQ\n\n#### How to include dot files\n\n```json\n{\n  \"ci-run-staged\": {\n    \"all\": {\n      \"{.,}*\": \"echo\"\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fci-run-staged","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fci-run-staged","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fci-run-staged/lists"}