{"id":28157060,"url":"https://github.com/opensource-nepal/commitlint","last_synced_at":"2025-09-10T05:12:02.100Z","repository":{"id":217162023,"uuid":"742362396","full_name":"opensource-nepal/commitlint","owner":"opensource-nepal","description":"Lint Conventional Commit message on GitHub Actions and pre-commit.","archived":false,"fork":false,"pushed_at":"2025-08-24T03:03:17.000Z","size":139,"stargazers_count":32,"open_issues_count":5,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-24T06:00:50.862Z","etag":null,"topics":["actions","commit","commit-lint","commit-message","commitlint","conventional","conventional-commit","git","github-actions","hooks","pr","pre-commit","pre-commit-hook","pull-requests","python","python-commitlint","semantic-commit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opensource-nepal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-12T09:59:56.000Z","updated_at":"2025-08-23T15:52:19.000Z","dependencies_parsed_at":"2024-02-29T12:10:49.526Z","dependency_job_id":"2f289899-0066-4b32-94b1-1e1bfc14c448","html_url":"https://github.com/opensource-nepal/commitlint","commit_stats":null,"previous_names":["opensource-nepal/commitlint"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/opensource-nepal/commitlint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-nepal%2Fcommitlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-nepal%2Fcommitlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-nepal%2Fcommitlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-nepal%2Fcommitlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensource-nepal","download_url":"https://codeload.github.com/opensource-nepal/commitlint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-nepal%2Fcommitlint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274416249,"owners_count":25280921,"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-09-10T02:00:12.551Z","response_time":83,"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":["actions","commit","commit-lint","commit-message","commitlint","conventional","conventional-commit","git","github-actions","hooks","pr","pre-commit","pre-commit-hook","pull-requests","python","python-commitlint","semantic-commit"],"created_at":"2025-05-15T08:16:07.443Z","updated_at":"2025-09-10T05:12:02.088Z","avatar_url":"https://github.com/opensource-nepal.png","language":"Python","readme":"# Conventional Commitlint\n\n[![PyPI version](https://badge.fury.io/py/commitlint.svg)](https://badge.fury.io/py/commitlint)\n[![CI status](https://github.com/opensource-nepal/commitlint/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/opensource-nepal/commitlint/actions)\n[![Downloads](https://img.shields.io/pypi/dm/commitlint.svg?maxAge=180)](https://pypi.org/project/commitlint/)\n[![codecov](https://codecov.io/github/opensource-nepal/commitlint/graph/badge.svg?token=lRmPZsIHb6)](https://codecov.io/github/opensource-nepal/commitlint)\n[![License](https://img.shields.io/pypi/l/commitlint?label=License)](https://github.com/opensource-nepal/commitlint/blob/main/LICENSE)\n\n`commitlint` is a tool that lints commit messages according to the [Conventional Commits](./docs/conventional-commits.md) standard. It can be used in GitHub Actions and as a pre-commit hook.\n\n## Usage\n\n### GitHub Actions\n\nIf you have an existing workflow, add the following steps:\n\n```yaml\n...\nsteps:\n    ...\n\n    - name: Conventional Commitlint\n      uses: opensource-nepal/commitlint@v1\n\n    ...\n```\n\nIf you don't have any workflows, create a new GitHub workflow file, e.g., `.github/workflows/commitlint.yaml`:\n\n```yaml\nname: Conventional Commitlint\n\non:\n  push:\n    branches: [\"main\"]\n  pull_request:\n\njobs:\n  commitlint:\n    runs-on: ubuntu-latest\n    name: Conventional Commitlint\n    permissions:\n      contents: read\n      pull-requests: read\n    steps:\n      - name: Conventional Commitlint\n        uses: opensource-nepal/commitlint@v1\n```\n\n\u003e **_Note:_** The `commitlint` GitHub Action is triggered only by `push`, `pull_request`, or `pull_request_target` events.\n\n#### GitHub Action Permissions\n\nThe action requires read permission for the following scopes:\n\n- `contents: read` : This allows the action to list commits of the repository.\n- `pull-requests: read` : This allows the action to list the commits in a Pull Request.\n\nFor public repositories, these permissions are granted by default.\nFor private repositories, you must explicitly grant them, either in:\n\n- the [repository’s default workflow permissions](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions), or\n- the [workflow/job permissions block](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions)\n\nWithout these, you may encounter an error like:\n\n```\nGithub API failed with status code 403. Response: {'message': 'Resource not accessible by integration', 'documentation_url': 'https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request', 'status': '403'}\n```\n\n#### GitHub Action Inputs\n\n| #   | Name              | Type    | Default                | Description                                                           |\n| --- | ----------------- | ------- | ---------------------- | --------------------------------------------------------------------- |\n| 1   | **fail_on_error** | Boolean | `true`                 | Whether the GitHub Action should fail if commitlint detects an issue. |\n| 2   | **verbose**       | Boolean | `false`                | Enables verbose output.                                               |\n| 3   | **token**         | String  | `secrets.GITHUB_TOKEN` | GitHub Token for fetching commits using the GitHub API.               |\n\n#### GitHub Action Outputs\n\n| #   | Name          | Type    | Description                                                  |\n| --- | ------------- | ------- | ------------------------------------------------------------ |\n| 1   | **exit_code** | Integer | The exit code of the commitlint step.                        |\n| 2   | **status**    | String  | The outcome of the commitlint step (`success` or `failure`). |\n\n### Pre-commit\n\n1. Add the following configuration to `.pre-commit-config.yaml`:\n\n   ```yaml\n   repos:\n      ...\n      - repo: https://github.com/opensource-nepal/commitlint\n        rev: v1.3.0\n        hooks:\n          - id: commitlint\n      ...\n   ```\n\n2. Install the `commit-msg` hook in your project repository:\n\n   ```bash\n   pre-commit install --hook-type commit-msg\n   ```\n\n   Running only `pre-commit install` will not work.\n\n\u003e **_Note:_** Avoid using commit messages that start with `#`, as this may cause unexpected behavior with `commitlint`.\n\n## CLI (Command Line Interface)\n\nFor CLI usage, please refer to [cli.md](./docs/cli.md).\n\n## Contribution\n\nWe appreciate feedback and contributions to this package. To get started, please see our [contribution guide](./CONTRIBUTING.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensource-nepal%2Fcommitlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensource-nepal%2Fcommitlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensource-nepal%2Fcommitlint/lists"}