{"id":50403568,"url":"https://github.com/kitconcept/image-checker","last_synced_at":"2026-05-31T00:30:58.930Z","repository":{"id":343804909,"uuid":"1179152967","full_name":"kitconcept/image-checker","owner":"kitconcept","description":"A GitHub Action that validates image files added to a repository against configurable size and dimension constraints","archived":false,"fork":false,"pushed_at":"2026-03-12T02:03:44.000Z","size":1381,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-14T09:58:37.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/kitconcept.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-11T18:35:58.000Z","updated_at":"2026-03-12T02:03:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kitconcept/image-checker","commit_stats":null,"previous_names":["kitconcept/image-checker"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kitconcept/image-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fimage-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fimage-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fimage-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fimage-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitconcept","download_url":"https://codeload.github.com/kitconcept/image-checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fimage-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33715211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":[],"created_at":"2026-05-31T00:30:58.297Z","updated_at":"2026-05-31T00:30:58.923Z","avatar_url":"https://github.com/kitconcept.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/marketplace/actions/image-checker\"\u003e\n    \u003cimg alt=\"Image Checker GitHub Actions logo\" width=\"200px\" src=\"https://raw.githubusercontent.com/kitconcept/image-checker/main/docs/icon.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n  Image Checker\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub Actions Marketplace](https://img.shields.io/badge/action-marketplace-blue.svg?logo=github\u0026color=orange)](https://github.com/marketplace/actions/image-checker)\n[![Release version badge](https://img.shields.io/github/v/release/kitconcept/image-checker)](https://github.com/kitconcept/image-checker/releases)\n\n![GitHub Repo stars](https://img.shields.io/github/stars/kitconcept/image-checker?style=flat-square)\n[![license badge](https://img.shields.io/github/license/kitconcept/image-checker)](./LICENSE)\n\n\u003c/div\u003e\n\nA GitHub Action that validates image files added to a repository against configurable size and dimension constraints.\nDesigned to prevent large or oversized images from being committed to projects.\n\n\n## Configuration options\n\n| GitHub Action Input   | Summary                                                                   | Default Value                          | Required |\n|-----------------------|---------------------------------------------------------------------------|----------------------------------------|----------|\n| `paths`               | Comma-separated directory paths to scan for images (repository-relative). |                                        | ✅       |\n| `file-extensions`     | Comma-separated file extensions to match when scanning `paths`.           | `png,jpg,jpeg,gif,webp,avif,tiff,svg`  |          |\n| `min-size`            | Minimum file size in **bytes**. Files smaller than this are flagged.      |                                        |          |\n| `max-size`            | Maximum file size in **bytes**. Files larger than this are flagged.       |                                        |          |\n| `min-width`           | Minimum image width in **pixels**. Images narrower than this are flagged. |                                        |          |\n| `max-width`           | Maximum image width in **pixels**. Images wider than this are flagged.    |                                        |          |\n| `min-height`          | Minimum image height in **pixels**. Images shorter than this are flagged. |                                        |          |\n| `max-height`          | Maximum image height in **pixels**. Images taller than this are flagged.  |                                        |          |\n| `fail-on-error`       | Set to `false` to report violations as warnings without failing the workflow. | `true`                             |          |\n| `summary-title`       | Title for the GitHub Step Summary section.                                    | `Image Checker`                    |          |\n\n\u003e All size/dimension inputs are optional. If none are provided, the action\n\u003e simply verifies that all matched files exist.\n\n## Outputs\n\n| Output         | Summary                                           |\n|----------------|-------------------------------------------------------|\n| `failed-files` | Comma-separated list of files that failed any check.  |\n| `failed-count` | Number of files that failed one or more checks.       |\n\n---\n\n## Usage\n\n### Basic example\n\n```yaml\n- name: Check images\n  uses: kitconcept/image-checker@v1\n  with:\n    file-extensions: 'jpg,png'\n    paths: 'src/plonetheme.mytheme/static, docs'\n    max-size: '2097152'   # 2 MB\n    max-width: '1920'\n    max-height: '1080'\n    summary-title: 'Check images'   # optional: customise the Step Summary heading\n```\n\n### With a changed-files step (recommended for PRs)\n\nPair with [tj-actions/changed-files](https://github.com/tj-actions/changed-files) to automatically check only the images modified in a pull request.\n```yaml\nname: Check New Images\n\n# ---------------------------------------------------------------------------\n# Example: how a project would consume the image-checker action.\n#\n# Copy this file into YOUR project repository at:\n#   .github/workflows/check-images.yml\n#\n# Adjust the `with:` block to match your project's requirements.\n# ---------------------------------------------------------------------------\n\non:\n  pull_request:\n    paths:\n      # Only run when image files are touched in the PR.\n      - '**/*.png'\n      - '**/*.jpg'\n      - '**/*.jpeg'\n      - '**/*.gif'\n      - '**/*.webp'\n      - '**/*.avif'\n      - '**/*.tiff'\n      - '**/*.svg'\n\njobs:\n  image-check:\n    name: Validate Images\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n\n      - name: Detect changed image files\n        id: changed\n        uses: tj-actions/changed-files@v44\n        with:\n          files: |\n            **/*.png\n            **/*.jpg\n            **/*.jpeg\n            **/*.gif\n            **/*.webp\n            **/*.avif\n            **/*.tiff\n            **/*.svg\n\n      - name: Run Image Checker\n        if: steps.changed.outputs.any_changed == 'true'\n        id: image-check\n        uses: kitconcept/image-checker@v1   # \u003c-- replace with your repo\n        with:\n          # Comma-separated list of changed files (provided by tj-actions/changed-files)\n          paths: ${{ steps.changed.outputs.all_changed_files }}\n\n          # File-size limits (bytes)\n          max-size: '2097152'   # 2 MB – block large raw assets\n\n          # Dimension limits (pixels)\n          max-width:  '3840'    # 4 K width\n          max-height: '2160'    # 4 K height\n\n      - name: Report results\n        if: always() \u0026\u0026 steps.changed.outputs.any_changed == 'true'\n        run: |\n          echo \"Failed files : ${{ steps.image-check.outputs.failed-files }}\"\n          echo \"Failed count : ${{ steps.image-check.outputs.failed-count }}\"\n\n```\n\n---\n\n## Supported image formats\n\nDimension detection is handled by [image-size](https://github.com/image-size/image-size),\nwhich supports: **JPEG, PNG, WebP, GIF, AVIF, TIFF, SVG, HEIF/HEIC, BMP, ICO, and more**.\n\n---\n\n## Contribute\n\n- [Issue Tracker](https://github.com/kitconcept/image-checker/issues)\n- [Source Code](https://github.com/kitconcept/image-checker/)\n- [Documentation](https://github.com/kitconcept/image-checker/)\n\n### Development\n\nPlease **DO NOT** commit to version branches directly. Even for the smallest and most trivial fix.\n\n**ALWAYS** open a pull request and ask somebody else to merge your code. **NEVER** merge it yourself.\n\n\n#### Project structure\n\n```\nimage-checker/\n├── action.yml                      # Action metadata\n├── package.json\n├── src/\n│   ├── index.js                    # Entry point\n│   ├── checker.js                  # Core validation logic\n│   └── imageUtils.js               # Image dimension helpers (image-size)\n├── __tests__/\n│   └── checker.test.js             # Jest unit tests\n├── dist/                           # Compiled bundle (committed to repo)\n└── .github/\n    └── workflows/\n        ├── ci.yml                  # CI: lint, test, build verification\n        ├── release.yml             # Automated releases on version tags\n        └── example-consumer.yml   # Template for Plone projects\n```\n\n#### Prerequisites\n\n- Node.js 24+\n- pnpm 10+\n\n#### Setup\n\n```bash\ngit clone https://github.com/kitconcept/image-checker.git\ncd image-checker\nmake install\n```\n\n#### Running tests\n\n```bash\nmake test\n```\n\n#### Testing the action locally\n\nTwo options are available depending on how closely you want to simulate the real CI environment:\n\n**Option 1 — `make check` (quick filesystem test)**\n\nCalls the checker functions directly, no GitHub Actions runtime involved.\nUseful for fast iteration on paths and constraints.\n\n```bash\nmake check PATHS=src/content EXTENSIONS=png,jpg MAX_SIZE=2097152\n```\n\n**Option 2 — `make local-action` (full runtime simulation)**\n\nUses [`@github/local-action`](https://github.com/github/local-action) to emulate\nthe `@actions/core` runtime, reading inputs from a `.env` file. Closer to what\nhappens in CI.\n\n```bash\ncp .env.example .env\n# edit .env to set INPUT_PATHS and any constraints\nmake local-action\n```\n\n#### Building the distribution bundle\n\nThe action runs from `dist/index.js`, a self-contained bundle produced by\n[`@vercel/ncc`](https://github.com/vercel/ncc). **Always rebuild and commit\n`dist/` when you change source files.**\n\n```bash\nmake build\ngit add dist/\ngit commit -m \"chore: rebuild dist\"\n```\n\n**The CI pipeline will fail if `dist/` is out of sync with the source.**\n\n\n### Changelog\n\nEvery feature, bug fix, or notable change must include a news fragment in `news/` before merging.\n\n**Naming convention:**\n\n| Scenario | Filename |\n|---|---|\n| Work tracked by a GitHub issue | `news/\u003cissue-number\u003e.\u003ctype\u003e` |\n| No issue | `news/+\u003cshort-identifier\u003e.\u003ctype\u003e` |\n\n**Fragment types:** `breaking`, `feature`, `bugfix`, `documentation`, `internal`, `tests`\n\nWrite the text in past tense, user-oriented, and end with `@github_username`:\n\n```\n# news/42.feature\nAdded support for AVIF images. @ericof\n```\n\nPreview the rendered draft at any time (nothing is modified):\n\n```bash\nmake changelog\n```\n\n### Releasing the action\n\nReleases are managed locally with [release-it](https://github.com/release-it/release-it).\nNo CI workflow creates releases — everything runs from your machine.\n\n**Dry-run first** (no commits, no deletions, no pushes, no GitHub release):\n\n```bash\nmake dry-run\n```\n\n**Publish a release** (interactive wizard):\n\n```bash\nmake release\n```\n\n`make release` will, in order:\n\n1. Run the linter and test suite\n2. Show the changelog draft (contents of `news/` fragments)\n3. Ask for the new version number\n4. Update `CHANGES.md`, delete consumed news fragments, rebuild `dist/`\n5. Create a single commit, tag it `v\u003cversion\u003e`, and push to GitHub\n6. Create a GitHub Release with the changelog as release notes\n\nAfter releasing, advance the floating major-version tag so consumers using\n`kitconcept/image-checker@v1` automatically get the latest stable release:\n\n```bash\ngit tag -fa v1 -m \"Update v1 tag\"\ngit push origin v1 --force\n```\n\n## Credits\n\n[![kitconcept GmbH](https://raw.githubusercontent.com/kitconcept/image-checker/main/docs/kitconcept.png)](https://kitconcept.com)\n\n## License\n\nThe project is licensed under [MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitconcept%2Fimage-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitconcept%2Fimage-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitconcept%2Fimage-checker/lists"}