{"id":19152742,"url":"https://github.com/traefik/hub-static-analyzer-action","last_synced_at":"2025-08-23T15:19:37.301Z","repository":{"id":250322208,"uuid":"708745724","full_name":"traefik/hub-static-analyzer-action","owner":"traefik","description":"Github Action for Hub static analyzer","archived":false,"fork":false,"pushed_at":"2025-07-24T15:48:05.000Z","size":253,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-08-19T19:10:19.532Z","etag":null,"topics":["traefik-hub"],"latest_commit_sha":null,"homepage":"https://hub.traefik.io","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traefik.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":"2023-10-23T09:58:06.000Z","updated_at":"2025-07-24T15:48:08.000Z","dependencies_parsed_at":"2025-01-03T18:44:29.276Z","dependency_job_id":"3272919c-cae7-41dc-bc08-8c9256e21fec","html_url":"https://github.com/traefik/hub-static-analyzer-action","commit_stats":null,"previous_names":["traefik/hub-static-analyzer-action"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/traefik/hub-static-analyzer-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fhub-static-analyzer-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fhub-static-analyzer-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fhub-static-analyzer-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fhub-static-analyzer-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traefik","download_url":"https://codeload.github.com/traefik/hub-static-analyzer-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fhub-static-analyzer-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271754356,"owners_count":24815185,"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-08-23T02:00:09.327Z","response_time":69,"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":["traefik-hub"],"created_at":"2024-11-09T08:19:14.227Z","updated_at":"2025-08-23T15:19:37.278Z","avatar_url":"https://github.com/traefik.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\n\u003cdiv align=\"center\" style=\"margin: 30px;\"\u003e\n\u003ca href=\"https://hub.traefik.io/\"\u003e\n  \u003cimg src=\"https://doc.traefik.io/traefik-hub/img/traefik-hub-logo.svg\" style=\"width:250px;\" align=\"center\" /\u003e\n\u003c/a\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://hub.traefik.io\"\u003eLog In\u003c/a\u003e |\n    \u003ca href=\"https://doc.traefik.io/traefik-hub/\"\u003eDocumentation\u003c/a\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\u003cstrong\u003eTraefik Hub Static Analyzer GitHub Action\u003c/strong\u003e\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003c/div\u003e\n\n# About\n\nThis GitHub Action performs static analysis on Traefik Hub Custom Resource Definitions (CRD) manifests.  \nIt allows you to lint the manifests and generate a diff report between commits.\n\n\u003c!-- Here a link to the upcoming public binary repo --\u003e\n\n\u003e If you run this action in a public repository or if you are a GitHub Enterprise customer,\nyou can leverage the SARIF output format to [submit a code scanning artifact](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github).\n\n## Usage\n\n```yaml\nname: Traefik Hub Static Analysis\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v4\n\n    - name: Run Traefik Hub Static Analyzer\n      uses: traefik/hub-static-analyzer-action@main\n      env:\n        GH_TOKEN: # \u003c== Required GitHub Token here.\n      with:\n        # Version of hub-static-analyzer to use.\n        # By default, the latest supported version will be used.\n        version: \"latest\"\n\n        # Path to the directory containing the manifests to analyze.\n        # By default, the current directory will be used.\n        path: \"path/to/manifests\"\n\n        ## Linting options:\n        # Enable linting.\n        # By default, \"false\".\n        lint: \"true\"\n\n        # Configure the output format of the linter. One of `unix`, `checkstyle` or `json`.\n        # By default, `unix` format will be used.\n        lint-format: \"unix\"\n\n        # Path where to store the linting results. The file will be overwritten if it exists.\n        # By default, in \"traefik-hub-static-analyzer-lint.out\".\n        lint-output-file: \"/path/to/output.lint.out\"\n\n        # Comma-separated list of rules to disable.\n        lint-disabled-rules: \"\"\n\n        ## Diff report options:\n        # Enable the generation of a diff report.\n        # By default, \"false\".\n        diff: \"true\"\n\n        # Range of commits on which to run the analysis.\n        # This could be a strict range: 5f6b21d...cff824e\n        # Or use relative references: HEAD~3...HEAD~1\n        # Or from a specific commit to HEAD: 5f6b21d\n        # By default, diff with unstaged changes.\n        diff-range: \"HEAD~1\"\n\n        # The file will be overwritten if it exists.\n        # By default, in \"traefik-hub-static-analyzer-diff.out\".\n        diff-output-file: \"/path/to/output.lint.out\"\n```\n\n## Example\n\nThe following example shows a fully configured workflow using this action and git hub token set in GH_TOKEN secret variable. The token is required to download public release of _hub-static-analyzer_ with `gh` cli, see [here](https://github.com/cli/cli/discussions/3820).\n\n```yaml\nname: Traefik Hub Static Analyzer\n\non:\n  pull_request:\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    permissions:\n      checks: write\n      contents: write\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Lint Traefik Hub CRs with hub-static-analyzer\n        uses: traefik/hub-static-analyzer-action@main\n        env:\n          GH_TOKEN: ${{ secrets.GH_TOKEN }}\n        with:\n          exclude: \"apps/overlays/local/*\"\n          lint: true\n          lint-format: checkstyle\n          lint-output-file: ./output.xml\n\n      - name: Annotate code\n        if: ${{ !cancelled() }}\n        uses: Juuxel/publish-checkstyle-report@v1\n        with:\n          reports: |\n            ./output.xml\n\n  diff:\n    runs-on: ubuntu-latest\n    permissions:\n      checks: write\n      contents: write\n      pull-requests: write\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Diff Traefik Hub CRs with hub-static-analyzer\n        uses: traefik/hub-static-analyzer-action@main\n        env:\n          GH_TOKEN: ${{ secrets.GH_TOKEN }}\n        with:\n          diff: true\n          diff-range: \"origin/${{ github.base_ref }}...pull/${{ github.ref_name }}\"\n          diff-output-file: ./output.md\n\n      - name: Prepare report\n        shell: bash\n        run: |\n          # Prepare report\n          set -u\n\n          echo \"# Traefik Hub Report\" \u003e header.md\n          echo \"\" \u003e\u003e header.md\n          echo \"The following changes have been detected.\" \u003e\u003e header.md\n          echo \"\" \u003e\u003e header.md\n\n      - name: Write report\n        if: ${{ hashFiles('./output.md') != ''}}\n        uses: mshick/add-pr-comment@v2\n        env:\n          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}\n        with:\n          message-path: |\n            header.md\n            output.md\n```\n\n## Scenarios\n\n1. [Lint your manifests and display linting errors in the PR](#lint-your-manifests-and-display-linting-errors-in-the-pr)\n2. [Generate a diff report and add the report to the PR](#generate-a-diff-report-and-display-it-in-the-pr)\n\n### Lint your manifests and display linting errors in the PR\n\nThis is an example of how to configure this GitHub action to lint your manifests in `checkstyle` format.  \nThe [Publish Checkstyle Report Action](https://github.com/Juuxel/publish-checkstyle-report) is used to display the `checkstyle` errors\nas inline code annotations.\n\n```yaml\nname: Traefik Hub Static Analyzer\n\non:\n  pull_request:\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    permissions:\n      checks: write\n      contents: write\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Lint Traefik Hub CRDs with hub-static-analyzer\n        uses: traefik/hub-static-analyzer-action@main\n        env:\n          GH_TOKEN: ${{ secrets.GH_TOKEN }}\n        with:\n          exclude: \"apps/overlays/local/*\"\n          lint: true\n          lint-format: checkstyle\n          lint-output-file: ./output.xml\n\n      - name: Annotate code\n        if: ${{ !cancelled() }}\n        uses: Juuxel/publish-checkstyle-report@v1\n        with:\n          reports: |\n            ./output.xml\n```\n\n![Image a linting error](./assets/lint-error.png \"Image on a linting error\")\n\n### Generate a diff report and display it in the PR\n\nThis is an example of how to configure this GitHub action to generate a diff report to show the changes between Git commits.  \nThe [add-pr-comment action](https://github.com/mshick/add-pr-comment \"Link to https://github.com/mshick/add-pr-comment\") is used to add the report as a comment to the PR.\n\n```yaml\nname: Traefik Hub Static Analyzer\n\non:\n  pull_request:\n\njobs:\n  diff:\n    runs-on: ubuntu-latest\n    permissions:\n      checks: write\n      contents: write\n      pull-requests: write\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Lint Traefik Hub CRDs with hub-static-analyzer\n        uses: traefik/hub-static-analyzer-action@main\n        env:\n          GH_TOKEN: ${{ secrets.GH_TOKEN }}\n        with:\n          diff: true\n          diff-range: \"origin/${GITHUB_BASE_REF}...origin/${GITHUB_HEAD_REF}\"\n          diff-output-file: ./output.md\n\n      - name: Prepare report\n        shell: bash\n        run: |\n          set -u\n\n          echo \"# Traefik Hub Report\" \u003e header.md\n          echo \"\" \u003e\u003e header.md\n          echo \"The following changes have been detected.\" \u003e\u003e header.md\n          echo \"\" \u003e\u003e header.md\n\n      - name: Write report\n        if: ${{ hashFiles('./output.md') != ''}}\n        uses: mshick/add-pr-comment@v2\n        with:\n          message-path: |\n            header.md\n            output.md\n```\n\n![Image of a diff report](./assets/diff-report.png \"Image of a diff report\")\n\n## License\n\nThe content in this repository is licensed under the [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0 \"Link to Apache 2 license\").\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraefik%2Fhub-static-analyzer-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraefik%2Fhub-static-analyzer-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraefik%2Fhub-static-analyzer-action/lists"}