{"id":16284996,"url":"https://github.com/jwgmeligmeyling/checkstyle-github-action","last_synced_at":"2025-03-20T02:31:25.082Z","repository":{"id":37788296,"uuid":"272183736","full_name":"jwgmeligmeyling/checkstyle-github-action","owner":"jwgmeligmeyling","description":"Push Chekcstyle results as check run annotations","archived":false,"fork":false,"pushed_at":"2023-10-16T18:44:22.000Z","size":986,"stargazers_count":13,"open_issues_count":24,"forks_count":22,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-09T21:12:16.724Z","etag":null,"topics":["checkstyle","github-actions","github-actions-java","static-analysis"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/jwgmeligmeyling.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}},"created_at":"2020-06-14T10:58:11.000Z","updated_at":"2023-08-30T18:11:15.000Z","dependencies_parsed_at":"2024-06-18T19:51:27.418Z","dependency_job_id":"ea865237-c1df-4fca-afea-b52024941b38","html_url":"https://github.com/jwgmeligmeyling/checkstyle-github-action","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.19999999999999996","last_synced_commit":"a12be500c097a5cedab881d4785ef9b4a4d3ee6a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwgmeligmeyling%2Fcheckstyle-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwgmeligmeyling%2Fcheckstyle-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwgmeligmeyling%2Fcheckstyle-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwgmeligmeyling%2Fcheckstyle-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwgmeligmeyling","download_url":"https://codeload.github.com/jwgmeligmeyling/checkstyle-github-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047544,"owners_count":20389203,"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":["checkstyle","github-actions","github-actions-java","static-analysis"],"created_at":"2024-10-10T19:21:50.756Z","updated_at":"2025-03-20T02:31:24.528Z","avatar_url":"https://github.com/jwgmeligmeyling.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build-test](https://github.com/jwgmeligmeyling/checkstyle-github-action/workflows/build-test/badge.svg)\n\n# Checkstyle GitHub Action\n\nThis action pushes results from [Checkstyle](https://checkstyle.github.io/) as check run annotations. :rocket:\n\nThe action can also be used for any other static analysis tools that produce reports in the Checkstyle XML format.\nThe report itself must be generated in a former build step, for example a Maven build.\n\n![example](images/example.png)\n\n## Input\n\n### `path`\nRequired. A file, directory or wildcard pattern that describes where to find the reports.\nMultiple files can be processed through a [glob expression](https://github.com/actions/toolkit/tree/master/packages/glob), for example: `'**/checkstyle.xml'`.\n\n### `name`\nOptional. Name for the check run to create. Defaults to `Checkstyle`.\n\n### `title`\nOptional. Title for the check run to create. Defaults to `Checkstyle Source Code Analyzer report`.\n\n### `token`\nOptional. GitHub API access token. Defaults to `${{ github.token }}`, which is set by `actions/checkout@v2` minimally.\n\n## Example usage\n\n```yaml\nname: Java CI\n\non: [push]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - name: Set up JDK 1.8\n      uses: actions/setup-java@v1\n      with:\n        java-version: 1.8\n    - uses: actions/cache@v1\n      with:\n        path: ~/.m2/repository\n        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}\n        restore-keys: |\n          ${{ runner.os }}-maven-\n    - name: Build with Maven\n      run: mvn -B verify checkstyle:checkstyle\n    - uses: jwgmeligmeyling/checkstyle-github-action@master\n      with:\n        path: '**/checkstyle-result.xml'\n```\n\nAnd do not forget to enable XML output for the Maven plugin:\n\n```xml\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    \u003cplugin\u003e\n      \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n      \u003cartifactId\u003emaven-checkstyle-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e3.1.1\u003c/version\u003e\n      \u003cconfiguration\u003e\n        \u003cfailsOnError\u003efalse\u003c/failsOnError\u003e\n      \u003c/configuration\u003e\n    \u003c/plugin\u003e\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\nPlease note that by default workflows on `pull_request` events checkout [`refs/pull/:prNumber/merge`](https://help.github.com/en/actions/reference/events-that-trigger-workflows) instead of the head of the pull request.\nDue to this, line numbers for the generated violations may not align with the actual line numbers to which they are displayed on the `HEAD`.\nAs it is, there is not really a sensible way to run this action on the merge commit of the pull request, because the result would be posted to an unnamed workflow for an otherwise invisible commit.\nEven for `pull_request` events there is the possibility to checkout the pull request head instead. In order to do so, change your `checkout` action accordingly:\n\n```yaml\n- uses: actions/checkout@v2\n  with:\n    ref: ${{ github.event.pull_request.head.sha }}\n```\n\n## Other relevant actions\nThis is a Github Action in a series of other GitHub Actions. Similar actions include:\n\n* [checkstyle-github-action](https://github.com/jwgmeligmeyling/checkstyle-github-action)\n* [pmd-github-action](https://github.com/jwgmeligmeyling/pmd-github-action)\n* [spotbugs-github-action](https://github.com/jwgmeligmeyling/spotbugs-github-action)\n\n## Known limitations\nDue to GitHub API limitations, we cannot specify to which Workflow Run (or underlying Check Suite) a newly created Check Run should be associated.\nAs a result, workflows that trigger on several types of events, might push results under another event than the action was run in.\nFor more information, see: https://github.com/jwgmeligmeyling/checkstyle-github-action/issues/2\n\n## Contributing\n\nInstall the dependencies  \n```bash\n$ npm install\n```\n\nBuild the typescript and package it for distribution\n```bash\n$ npm run build \u0026\u0026 npm run package\n```\n\nRun the tests :heavy_check_mark:  \n```bash\n$ npm test\n\n PASS  ./index.test.js\n  ✓ throws invalid number (3ms)\n  ✓ wait 500 ms (504ms)\n  ✓ test runs (95ms)\n\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwgmeligmeyling%2Fcheckstyle-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwgmeligmeyling%2Fcheckstyle-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwgmeligmeyling%2Fcheckstyle-github-action/lists"}