{"id":34687818,"url":"https://github.com/leinardi/gha-pre-commit-shellcheck-reviewdog","last_synced_at":"2026-04-19T21:04:44.338Z","repository":{"id":328783109,"uuid":"1111267709","full_name":"leinardi/gha-pre-commit-shellcheck-reviewdog","owner":"leinardi","description":"GitHub Action to run shellcheck via pre-commit and comment results on PRs using reviewdog.","archived":false,"fork":false,"pushed_at":"2025-12-15T09:17:22.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T01:21:33.241Z","etag":null,"topics":["gh-leinardi-iac","github-actions","pre-commit","reviewdog","shellcheck"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/leinardi.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-06T15:56:27.000Z","updated_at":"2025-12-15T09:17:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leinardi/gha-pre-commit-shellcheck-reviewdog","commit_stats":null,"previous_names":["leinardi/gha-pre-commit-shellcheck-reviewdog"],"tags_count":3,"template":false,"template_full_name":"leinardi/gha-pre-commit-reviewdog-template","purl":"pkg:github/leinardi/gha-pre-commit-shellcheck-reviewdog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinardi%2Fgha-pre-commit-shellcheck-reviewdog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinardi%2Fgha-pre-commit-shellcheck-reviewdog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinardi%2Fgha-pre-commit-shellcheck-reviewdog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinardi%2Fgha-pre-commit-shellcheck-reviewdog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leinardi","download_url":"https://codeload.github.com/leinardi/gha-pre-commit-shellcheck-reviewdog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leinardi%2Fgha-pre-commit-shellcheck-reviewdog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32022561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["gh-leinardi-iac","github-actions","pre-commit","reviewdog","shellcheck"],"created_at":"2025-12-24T21:55:28.100Z","updated_at":"2026-04-19T21:04:44.333Z","avatar_url":"https://github.com/leinardi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Run shellcheck via pre-commit + reviewdog\n\nThis GitHub Action runs `shellcheck` via [`pre-commit`](https://pre-commit.com/) on a ref range and reports:\n\n- **Diagnostics** (JSON-based) as inline comments\n- **Suggested fixes** as a diff review\n\nusing [reviewdog](https://github.com/reviewdog/reviewdog).\n\nIt combines:\n\n- `shellcheck-json-output` (JSON output; diagnostics)\n- `shellcheck-diff-output` (diff output; suggestions)\n\n## Requirements\n\nAdd the shellcheck hooks to your `.pre-commit-config.yaml` (using a local repo), for example:\n\n```yaml\nrepos:\n  - repo: local\n    hooks:\n      - id: shellcheck\n        name: shellcheck\n        entry: shellcheck\n        language: system\n        types: [shell]\n        args: [\"-x\"]\n      - id: shellcheck\n        alias: shellcheck-diff-output\n        name: shellcheck (diff output)\n        entry: shellcheck\n        language: system\n        types: [shell]\n        args: [\"-f\", \"diff\", \"-x\"]\n        stages: [manual]\n      - id: shellcheck\n        alias: shellcheck-json-output\n        name: shellcheck (json output)\n        entry: shellcheck\n        language: system\n        types: [shell]\n        args: [\"-f\", \"json\", \"-x\"]\n        stages: [manual]\n````\n\nYou also need:\n\n- GitHub Actions enabled on the repository\n- `secrets.GITHUB_TOKEN` available (default on GitHub-hosted runners)\n- A runner where `shellcheck` is available\n  – on `ubuntu-latest`, this action installs `shellcheck` and `jq` via `apt`\n- `actions/checkout` fetching enough history to include both `from-ref` and `to-ref`, for example:\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    fetch-depth: 0\n```\n\n## Inputs\n\n| Name           | Required | Description                                         |\n|----------------|----------|-----------------------------------------------------|\n| `from-ref`     | ✅        | Base git ref (e.g. PR base SHA)                     |\n| `to-ref`       | ✅        | Head git ref (e.g. PR head SHA)                     |\n| `github-token` | ✅        | GitHub token for reviewdog (`secrets.GITHUB_TOKEN`) |\n\n## Outputs\n\n| Name       | Description                                    |\n|------------|------------------------------------------------|\n| `exitcode` | Exit code of the `shellcheck-json-output` hook |\n\n## Usage\n\nExample workflow for pull requests:\n\n```yaml\nname: Lint shell scripts with shellcheck\n\non:\n  pull_request:\n\njobs:\n  shellcheck:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Run shellcheck via pre-commit + reviewdog\n        uses: leinardi/gha-pre-commit-shellcheck-reviewdog@v1\n        with:\n          from-ref: ${{ github.event.pull_request.base.sha }}\n          to-ref: ${{ github.event.pull_request.head.sha }}\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nThis will:\n\n1. Run `shellcheck-json-output` on shell files changed between `from-ref` and `to-ref` and report diagnostics with links to the corresponding\n   ShellCheck wiki pages.\n2. Run `shellcheck-diff-output` to generate a diff of suggested fixes and post it as a review (`shellcheck (suggestion)`).\n3. Fail the job if issues are found.\n\n## Versioning\n\nIt’s recommended to pin to the major version:\n\n```yaml\nuses: leinardi/gha-pre-commit-shellcheck-reviewdog@v1\n```\n\nFor fully reproducible behavior, pin to an exact tag:\n\n```yaml\nuses: leinardi/gha-pre-commit-shellcheck-reviewdog@v1.0.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleinardi%2Fgha-pre-commit-shellcheck-reviewdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleinardi%2Fgha-pre-commit-shellcheck-reviewdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleinardi%2Fgha-pre-commit-shellcheck-reviewdog/lists"}