{"id":25867047,"url":"https://github.com/hudsonm62/compare-action","last_synced_at":"2026-05-01T20:32:31.888Z","repository":{"id":235749932,"uuid":"791159830","full_name":"hudsonm62/compare-action","owner":"hudsonm62","description":"📂 Simply compares 2 paths to see if they are the same or different. Supports globs, dates, and a handful of ignores.","archived":false,"fork":false,"pushed_at":"2026-04-21T22:51:50.000Z","size":234,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-22T00:36:40.481Z","etag":null,"topics":["cross-platform","dir-compare","github-actions","nodejs"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/compare-action","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/hudsonm62.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-24T07:49:48.000Z","updated_at":"2024-08-08T12:14:31.000Z","dependencies_parsed_at":"2024-05-05T09:33:41.285Z","dependency_job_id":"ee806f45-3088-4502-998e-8fe1a0de8fdc","html_url":"https://github.com/hudsonm62/compare-action","commit_stats":null,"previous_names":["hudsonm62/compare-action"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hudsonm62/compare-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudsonm62%2Fcompare-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudsonm62%2Fcompare-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudsonm62%2Fcompare-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudsonm62%2Fcompare-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hudsonm62","download_url":"https://codeload.github.com/hudsonm62/compare-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudsonm62%2Fcompare-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32512662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["cross-platform","dir-compare","github-actions","nodejs"],"created_at":"2025-03-02T03:33:56.912Z","updated_at":"2026-05-01T20:32:31.870Z","avatar_url":"https://github.com/hudsonm62.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compare Action 🔃\n\n[![CI](https://github.com/hudsonm62/compare-action/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/hudsonm62/compare-action/actions/workflows/ci.yml)\n[![Prettier](https://img.shields.io/badge/Code%20Style-prettier-F7B93E?logo=Prettier)](https://github.com/hudsonm62/compare-action/blob/master/.prettierrc)\n[![License](https://img.shields.io/github/license/hudsonm62/compare-action)](https://github.com/hudsonm62/compare-action/blob/master/LICENSE)\n\n📂 Simply compares 2 paths to see if they are the same or different. Supports globs, dates, and a handful of ignores.\n\n\u003e By default, this will error if there are any differences, but it's behaviour can be configured as needed.\n\n## Usage\n\n```yaml\n- uses: actions/checkout@v4\n- uses: hudsonm62/compare-action@v1\n  with:\n    path1: \"path/to/first\"\n    path2: \"path/to/second\"\n    exclude: \"**/*.js,**/*.ts\"\n    #error_same: true\n```\n\n## Configuration\n\n### Inputs\n\n| Input                   | Default | Description                                                                                                                        |\n| ----------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| `path1`                 | `null`  | The first path to compare (required)                                                                                               |\n| `path2`                 | `null`  | The second path to compare (required)                                                                                              |\n| `exclude`               | `null`  | Relative [minimatch] Glob pattern to filter out - Specify multiple patterns by separating with a comma (i.e. \"`**/*.js,**/*.ts`\"). |\n| `include`               | `null`  | Relative [minimatch] Glob pattern to filter in - Specify multiple patterns by separating with a comma (i.e. \"`**/*.js,**/*.ts`\").  |\n| `log_path`              | `null`  | This is the path to write the log file. Only turns on file logging if this is set. Doesn't discriminate between `\\` and `/`.       |\n| `compare_size`          | `true`  | If true, will compare the size of the files (always first).                                                                        |\n| `compare_content`       | `true`  | If true, will compare the content of the files.                                                                                    |\n| `compare_symlinks`      | `false` | If true, compares symbolic links directly instead of their targets.                                                                |\n| `error_same`            | `false` | If true, the action will fail if the files are the same. This changes depending on `no_error` and `warn_instead`                   |\n| `no_error`              | `false` | Disable errors. Simply outputs results.                                                                                            |\n| `warn_instead`          | `false` | If true, replaces any diff-related failing errors with just a warning.                                                             |\n| `output_diff`           | `false` | If true, outputs each compare result to console (matched or not) line by line. Not recommended for large file sets.                |\n| `ignore_line_endings`   | `false` | If true, will ignore line endings when comparing files - CRLF/LF.                                                                  |\n| `ignore_whitespace`     | `false` | If true, ignore any whitespace only at both the beginning and end of a line.                                                       |\n| `ignore_all_whitespace` | `false` | If true, ignores ALL whitespace in files.                                                                                          |\n| `ignore_empty_lines`    | `false` | If true, ignores empty lines when comparing files.                                                                                 |\n| `ignore_empty_dirs`     | `false` | If true, ignores empty directories when comparing directories.                                                                     |\n| `ignore_subdirs`        | `false` | If true, skips subdirectories when comparing directories. Effectively only compares the root of the paths.                         |\n| `ignore_name_case`      | `false` | If true, ignores the casing of the file names.                                                                                     |\n| `compare_only_name`     | `false` | If true, only compares the name of the files. (can be used in tandem with `compare_date`)                                          |\n| `compare_date`          | `false` | If true, will _also_ compare the date of the files. (can be used in tandem with any `compare_**` flags)                            |\n\n### Outputs\n\n| Value           | Description                                                                        |\n| --------------- | ---------------------------------------------------------------------------------- |\n| `result`        | The result 'enum' of the comparison - `same`, `different`, `error`.                |\n| `log_path`      | The path to the log file that was written (assuming `log_path` input has a value). |\n| `distinct`      | The total number of items that are orphan/distinct.                                |\n| `equal`         | The total number of items that are the same.                                       |\n| `different`     | The total number of items with differences.                                        |\n| `total_folders` | The total number of folders compared.                                              |\n| `total_files`   | The total number of files compared.                                                |\n| `total`         | The total number of items compared.                                                |\n\n\u003e Inputs `path1` and `path2` will automatically get converted to their platform-specific path.\u003cbr\u003e_Always_ use `/` in your Globs, it will still work.\n\n## Common Problems\n\n- **Exclude Glob isn't working**\n  - Double check its actually a [minimatch] glob pattern.\n  - Make sure the pattern is relative to the root of the comparing directory (`path1`/`path2`) and NOT your `cwd`.\n    - For example, if you want to exclude `thisFolder` folder, you would use something like `**/thisFolder/**` (or `./thisFolder` if it's always in the root of the comparing directory).\n- **Out of Memory?**\n  - Turn off `output_diff` if you have a large file set, as it prevents the array of results from being created.\n  - Alternatively, you can split the Action into multiple steps that compare smaller sets at a time.\n  - You can also try playing with the `compare_size` and `compare_content` flags to see if you can reduce the memory usage.\n- **\"No such file or directory\"**\n  - Ensure you've checked out your repo\n  - Check the job has at least `read` for `contents` permissions.\n  - If you're using a relative path, make sure you're in the right directory.\n\n## Credits\n\nThis is essentially an Action wrapper for [dir-compare](https://www.npmjs.com/package/dir-compare) - Go check it out out!\n\n## License\n\nThis project is licensed under the MIT License\n\n[minimatch]: https://github.com/isaacs/minimatch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhudsonm62%2Fcompare-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhudsonm62%2Fcompare-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhudsonm62%2Fcompare-action/lists"}