{"id":13496455,"url":"https://github.com/pre-commit/action","last_synced_at":"2025-05-15T14:03:14.950Z","repository":{"id":36384326,"uuid":"204199630","full_name":"pre-commit/action","owner":"pre-commit","description":"a GitHub action to run `pre-commit`","archived":false,"fork":false,"pushed_at":"2024-10-08T10:48:25.000Z","size":306,"stargazers_count":499,"open_issues_count":0,"forks_count":155,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-10T20:39:16.882Z","etag":null,"topics":["github-actions","pre-commit"],"latest_commit_sha":null,"homepage":"","language":null,"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/pre-commit.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"asottile","open_collective":"pre-commit","tidelift":"pypi/pre-commit"}},"created_at":"2019-08-24T18:55:46.000Z","updated_at":"2025-04-10T18:49:25.000Z","dependencies_parsed_at":"2023-02-19T15:31:20.995Z","dependency_job_id":"20c651fc-482d-4a7a-9b7c-ae634a99c05b","html_url":"https://github.com/pre-commit/action","commit_stats":{"total_commits":112,"total_committers":14,"mean_commits":8.0,"dds":0.5535714285714286,"last_synced_commit":"576ff52938d158a24ac7e009dfa94b1455e7df99"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre-commit%2Faction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre-commit%2Faction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre-commit%2Faction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre-commit%2Faction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pre-commit","download_url":"https://codeload.github.com/pre-commit/action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573049,"owners_count":21126752,"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":["github-actions","pre-commit"],"created_at":"2024-07-31T19:01:48.129Z","updated_at":"2025-04-12T13:27:51.884Z","avatar_url":"https://github.com/pre-commit.png","language":null,"readme":"this action is in maintenance-only mode and will not be accepting new features.\n\ngenerally you want to use [pre-commit.ci] which is faster and has more features.\n\n[pre-commit.ci]: https://pre-commit.ci\n\n___\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pre-commit/action/main.svg)](https://results.pre-commit.ci/latest/github/pre-commit/action/main)\n[![Build Status](https://github.com/pre-commit/action/actions/workflows/main.yml/badge.svg)](https://github.com/pre-commit/action/actions)\n\npre-commit/action\n=================\n\na GitHub action to run [pre-commit](https://pre-commit.com)\n\n### using this action\n\nTo use this action, make a file `.github/workflows/pre-commit.yml`.  Here's a\ntemplate to get started:\n\n```yaml\nname: pre-commit\n\non:\n  pull_request:\n  push:\n    branches: [main]\n\njobs:\n  pre-commit:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-python@v3\n    - uses: pre-commit/action@v3.0.1\n```\n\nThis does a few things:\n\n- clones the code\n- installs python\n- sets up the `pre-commit` cache\n\n### using this action with custom invocations\n\nBy default, this action runs all the hooks against all the files.  `extra_args`\nlets users specify a single hook id and/or options to pass to `pre-commit run`.\n\nHere's a sample step configuration that only runs the `flake8` hook against all\nthe files (use the template above except for the `pre-commit` action):\n\n```yaml\n    - uses: pre-commit/action@v3.0.1\n      with:\n        extra_args: flake8 --all-files\n```\n\n### using this action in private repositories\n\nprior to v3.0.0, this action had custom behaviour which pushed changes back to\nthe pull request when supplied with a `token`.\n\nthis behaviour was removed:\n- it required a PAT (didn't work with short-lived `GITHUB_TOKEN`)\n- properly hiding this `input` from the installation and execution of hooks\n  is intractable in github actions (it is readily available as `$INPUT_TOKEN`)\n- this meant potentially unvetted code could access the token via the\n  environment\n\nyou can _likely_ achieve the same thing with an external action such as\n[git-auto-commit-action] though you may want to take precautions to clear `git`\nhooks or other ways that arbitrary code execution can occur when running\n`git commit` / `git push` (for example [core.fsmonitor]).\n\nwhile unrelated to this action, [pre-commit.ci] avoids these problems by\ninstalling and executing isolated from the short-lived repository-scoped\n[installation access token].\n\n[git-auto-commit-action]: https://github.com/stefanzweifel/git-auto-commit-action\n[core.fsmonitor]: https://github.blog/2022-04-12-git-security-vulnerability-announced/\n[pre-commit.ci]: https://pre-commit.ci\n[installation access token]: https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app\n","funding_links":["https://github.com/sponsors/asottile","https://opencollective.com/pre-commit","https://tidelift.com/funding/github/pypi/pre-commit"],"categories":["Others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpre-commit%2Faction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpre-commit%2Faction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpre-commit%2Faction/lists"}