{"id":18952703,"url":"https://github.com/compwa/update-pre-commit","last_synced_at":"2025-09-02T11:38:24.661Z","repository":{"id":65155210,"uuid":"427893405","full_name":"ComPWA/update-pre-commit","owner":"ComPWA","description":"Composite GitHub Action to auto-update .pre-commit-config.yaml","archived":false,"fork":false,"pushed_at":"2025-01-22T14:01:52.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-22T14:34:07.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/ComPWA.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-14T10:05:23.000Z","updated_at":"2025-01-22T14:00:20.000Z","dependencies_parsed_at":"2024-11-08T13:39:01.348Z","dependency_job_id":"fc7c715e-7eb5-4c21-ab0e-819d9ffbe6a9","html_url":"https://github.com/ComPWA/update-pre-commit","commit_stats":{"total_commits":7,"total_committers":3,"mean_commits":"2.3333333333333335","dds":0.4285714285714286,"last_synced_commit":"b977c8415a3ca7941dca2f66c8aac2bd81fca74e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPWA%2Fupdate-pre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPWA%2Fupdate-pre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPWA%2Fupdate-pre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPWA%2Fupdate-pre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ComPWA","download_url":"https://codeload.github.com/ComPWA/update-pre-commit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239952598,"owners_count":19723922,"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":[],"created_at":"2024-11-08T13:34:22.358Z","updated_at":"2025-09-02T11:38:24.649Z","avatar_url":"https://github.com/ComPWA.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto-update pre-commit GitHub Action\n\nA small [custom, composite GitHub Action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) that is used by [ComPWA](https://github.com/ComPWA) repositories that pin constraints files (see [update-pip-constraints](https://github.com/ComPWA/update-pip-constraints)). The action is enforced in these repositories through [ComPWA/repo-maintenance](https://github.com/ComPWA/repo-maintenance).\n\n## Example workflow\n\n```yaml\njobs:\n  pre-commit:\n    name: pre-commit autoupdate\n    runs-on: ubuntu-24.04\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n      - name: Check if there are changes to pre-commit config\n        run: git diff origin/main --exit-code -- .pre-commit-config.yml\n        continue-on-error: true\n      - name: Update hooks in pre-commit config\n        if: success()\n        uses: ComPWA/update-pre-commit@v1\n\n  push:\n    name: Push changes\n    runs-on: ubuntu-24.04\n    needs:\n      - pre-commit\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          token: ${{ secrets.PAT }}\n        # GITHUB_TOKEN will not rerun checks after pushing to a PR branch\n      - uses: actions/download-artifact@v5\n        with:\n          path: pre-commit\n      - run: |\n          [[ -f .pre-commit-config.yaml ]] \u0026\u0026 mv -f .pre-commit-config.yaml ..\n        working-directory: pre-commit\n      - name: Commit and push changes\n        run: |\n          git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }}\n          git config --global user.name \"GitHub\"\n          git config --global user.email \"noreply@github.com\"\n          git checkout -b ${GITHUB_HEAD_REF}\n          if [[ $(git status -s) ]]; then\n            git add -A\n            git commit -m \"ci: upgrade pinned requirements (automatic)\"\n            git config pull.rebase true\n            git pull origin ${GITHUB_HEAD_REF}\n            git push origin HEAD:${GITHUB_HEAD_REF}\n          fi\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwa%2Fupdate-pre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompwa%2Fupdate-pre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwa%2Fupdate-pre-commit/lists"}