{"id":19466811,"url":"https://github.com/dena/unity-meta-check","last_synced_at":"2025-08-21T13:32:46.084Z","repository":{"id":37931130,"uuid":"339063961","full_name":"DeNA/unity-meta-check","owner":"DeNA","description":"A tool to check problems about meta files of Unity","archived":false,"fork":false,"pushed_at":"2024-06-10T06:47:48.000Z","size":336,"stargazers_count":84,"open_issues_count":1,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-01T20:00:44.369Z","etag":null,"topics":["autofix","ci","testing","tool","unity"],"latest_commit_sha":null,"homepage":"","language":"Go","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/DeNA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2021-02-15T12:01:46.000Z","updated_at":"2024-10-30T08:15:52.000Z","dependencies_parsed_at":"2024-03-28T02:33:53.727Z","dependency_job_id":"2b80ecf7-3ffe-4f38-b434-d259d917335d","html_url":"https://github.com/DeNA/unity-meta-check","commit_stats":{"total_commits":116,"total_committers":7,"mean_commits":"16.571428571428573","dds":"0.24137931034482762","last_synced_commit":"90b863adf316dac9974981b62bae67fac916dd5e"},"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Funity-meta-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Funity-meta-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Funity-meta-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Funity-meta-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeNA","download_url":"https://codeload.github.com/DeNA/unity-meta-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230516183,"owners_count":18238352,"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":["autofix","ci","testing","tool","unity"],"created_at":"2024-11-10T18:30:26.490Z","updated_at":"2024-12-20T00:08:34.773Z","avatar_url":"https://github.com/DeNA.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Unity meta checker\n=====================================\n\nA tool to check problems about [meta files](https://docs.unity3d.com/2021.1/Documentation/Manual/AssetWorkflow.html) of [Unity](https://unity.com/) on [Git](https://git-scm.com/) repositories, and also the tool can do limited autofix for meta files of auto-generated files.\n\nThis tool can check the following problems:\n\n\u003cdl\u003e\n\u003cdt\u003eMissing meta files\u003c/dt\u003e\n\u003cdd\u003e\u003cem\u003eMissing\u003c/em\u003e means that an asset should have a meta file but the meta file is not committed. This problem can cause broken asset references.\n\u003cdt\u003eDangling meta files\u003c/dt\u003e\n\u003cdd\u003e\u003cem\u003eDangling\u003c/em\u003e means that a meta file exist, but the asset is not committed. This problem can cause annoying warning messages.\n\u003c/dl\u003e\n\n\n\nBasic Usage\n-----------\n\n```console\n$ # Change the current directory to your Unity project or UPM package.\n$ cd /path/to/unity/project\n\n$ # Execute unity-meta-check (specifying -silent make that unity-meta-check only show results or fatal errors).\n$ unity-meta-check -silent\nmissing: Assets/Not/Added.meta\nmissing: Packages/com.my.pkg/README.meta\nmissing: LocalPackages/com.local.pkg/README.meta\n...\ndangling: Assets/Not/Removed.meta\ndangling: Packages/com.my.pkg/MyPkg.csproj.meta\ndangling: LocalPackages/com.local.pkg/LocalPkg.csproj.meta\n...\n\n$ # unity-meta-check exit with non-zero status if one or more missing/dangling .meta files exist.\n$ echo $?\n1\n```\n\nTypically, unity-meta-check don't need to specify the target type (Unity project or UPM package) because unity-meta-check can automatically detect it.\nYou can explicitly specify `-unity-project` or `-upm-package` to disable the automatic detection, if the detection result was not intended.\n\nIf you want to ignore some problems, you can use `.meta-check-ignore` (this format is very similar to `.gitignore` but `!` is not supported):\n\n```console\n$ unity-meta-check -silent\nmissing: Assets/Not/Added1.meta\nmissing: Assets/NotAdded2.meta\n\n$ # You can ignore these problems using .meta-check-ignore:\n$ cat .meta-check-ignore\nAssets/Not             # All files in the directory or the sub directories get ignored.\nAssets/NotAdded2.meta  # Also can specify the path to files.\n\n$ # unity-meta-check will ignore these problems.\n$ unity-meta-check -silent\n```\n\nSee [more advanced usage](#Advanced-Usage) for more information.\n\n\n\nInstallation\n------------\n### Using Docker Image\n\nThis way is recommended to use unity-meta-check on CI.\n\n```console\n$ docker pull ghcr.io/dena/unity-meta-check/unity-meta-check:latest\n\n$ cd path/to/your/proj \n$ docker run -v \"$(pwd):/target\" --rm ghcr.io/dena/unity-meta-check/unity-meta-check:latest -silent /target\nmissing Assets/AssetsMissing.meta\nmissing LocalPackages/com.example.local.pkg/LocalPkgMissing.meta\nmissing Packages/com.example.pkg/PkgMissing.meta\ndangling Assets/AssetsDangling.meta\ndangling LocalPackages/com.example.local.pkg/LocalPkgDangling.meta\ndangling Packages/com.example.pkg/PkgDangling.meta\n\n$ docker run --rm ghcr.io/dena/unity-meta-check/unity-meta-check:latest -help\nusage: unity-meta-check [\u003coptions\u003e] [\u003cpath\u003e]\n...\n```\n\n\n### Using GitHub Actions\n\nTo check only, the following YAML can cover almost case:\n\n```yaml\nname: Meta Check\non: pull_request\n\njobs:\n  meta-check:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: DeNA/unity-meta-check@v3\n```\n\nSee [`./action.yml`](./action.yml) for more detials.\n\n\u003cdetails\u003e\n\u003csummary\u003eAdvanced Usage for JUnit report + Autofix + PR Comment report\u003c/summary\u003e\n\nThe following YAML is the example for JUnit report + Autofix + PR Comment report:\n\n```yaml\nname: Meta Check\non: pull_request\n\njobs:\n  unity-meta-check:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: DeNA/unity-meta-check@v3\n        with:\n          enable_autofix: true\n          autofix_globs: .\n          enable_junit: true\n          junit_xml_path: junit.xml\n          enable_pr_comment: true\n          pr_comment_lang: ja\n          pr_comment_send_success: true\n        env:\n          GITHUB_TOKEN: \"${{ secrets.YOUR_GITHUB_TOKEN }}\"\n\n      - name: See how autofix did\n        run: git status\n        if: always()\n\n      - uses: mikepenz/action-junit-report@v2\n        with:\n          report_paths: junit.xml\n        if: always()\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAdvanced Usage for \u003ccode\u003epush\u003c/code\u003e events instead of \u003ccode\u003epull_request\u003c/code\u003e events\u003c/summary\u003e\n\n```yaml\nname: Meta Check\non: push\n\njobs:\n  meta-check:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: jwalton/gh-find-current-pr@v1\n        id: findPr\n\n      - uses: DeNA/unity-meta-check@v3\n          enable_pr_comment: true\n          pr_comment_pull_number: ${{ steps.findPr.outputs.number }}\n        env:\n          GITHUB_TOKEN: \"${{ secrets.YOUR_GITHUB_TOKEN }}\"\n```\n\u003c/details\u003e\n\n\n\n### Download binaries\n\nBinaries are available on [releases](https://github.com/dena/unity-meta-check/releases).\n\n\n\nAdvanced Usage\n--------------\n\nProvided features are built on several individual binaries:\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#unity-meta-check\"\u003e\u003ccode\u003eunity-meta-check\u003c/code\u003e\u003c/a\u003e\n\u003cdd\u003eChecker for missing/dangling meta files. The result print to stdout.\n\u003cdt\u003e\u003ca href=\"#unity-meta-autofix\"\u003e\u003ccode\u003eunity-meta-check-autofix\u003c/code\u003e\u003c/a\u003e\n\u003cdd\u003eAutofix for meta files problems. It need a result of \u003ccode\u003eunity-meta-check\u003c/code\u003e via stdin.\n\u003cdt\u003e\u003ca href=\"#unity-meta-check-junit\"\u003e\u003ccode\u003eunity-meta-check-junit\u003c/code\u003e\u003c/a\u003e\n\u003cdd\u003eReporter for Jenkins compatible XML based JUnit reports. It need a result of \u003ccode\u003eunity-meta-check\u003c/code\u003e from stdin.\n\u003cdt\u003e\u003ca href=\"#unity-meta-check-github-pr-comment\"\u003e\u003ccode\u003eunity-meta-check-github-pr-comment\u003c/code\u003e\u003c/a\u003e\n\u003cdd\u003eReporter for GitHub comments of GitHub issues or pull requests. It need a result of \u003ccode\u003eunity-meta-check\u003c/code\u003e from stdin.\n\u003c/dl\u003e\n\n\n\n### unity-meta-check\n\n`unity-meta-check` checks missing/dangling meta files on the commit.\n\nThis check based on [a git tree object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_tree_objects) instead of the working directory. It means you **MUST** commit adding missing meta files or removing dangling meta files to re-check by `unity-meta-check`.\n\nOther complemental features such as autofix or reporting are provided other binaries.\n\n```console\n$ unity-meta-check -help\nusage: unity-meta-check [\u003coptions\u003e] [\u003cpath\u003e]\n\nCheck missing or dangling .meta files.\n\n  \u003cpath\u003e\n        root directory of your Unity project or UPM package to check (default \"$(git rev-parse --show-toplevel)\")\n\nOPTIONS\n  -debug\n        set log level to DEBUG (default INFO)\n  -ignore-file string\n        path to .meta-check-ignore\n  -ignore-dangling\n        ignore dangling .meta\n  -ignore-submodules\n        ignore git submodules and nesting repositories (this is RECOMMENDED but not enabled by default because it can cause to miss problems in submodules or nesting repositories)\n  -no-ignore-case\n        treat case of file paths\n  -silent\n        set log level to WARN (default INFO)\n  -unity-project\n        check as Unity project\n  -unity-project-sub-dir\n        check as sub directory of Unity project\n  -upm-package\n        check as UPM package (same meaning of -unity-project-sub-dir)\n  -version\n        print version\n\nEXAMPLE USAGES\n  $ cd path/to/UnityProject\n  $ unity-meta-check -silent\n\n  $ cd path/to/any/dir\n  $ unity-meta-check -silent -upm-package path/to/MyUPMPackage\n  $ unity-meta-check -silent -unity-project-sub-dir path/to/UnityProject/Assets/Sub/Dir\n\nEXAMPLE USAGES WITH OTHER TOOLS\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-junit path/to/junit.xml\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-github-pr-comment \u003coptions\u003e\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-junit path/to/junit.xml | unity-meta-check-github-pr-comment \u003coptions\u003e\n```\n\nIf both `-silent` and `-debug` are specified, `-silent` win.\n\n\n\n### unity-meta-autofix\n\n`unity-meta-autofix` fix (very limited) problems about meta files. It needs a result of `unity-meta-check` via stdin. It can fix the following problems:\n\n\u003cdl\u003e\n\u003cdt\u003eMissing meta files for folders\n\u003cdd\u003e\n\u003cdetails\u003e\n\u003csummary\u003eExample of auto-generated meta files\u003c/summary\u003e\n\n```yaml\nfileFormatVersion: 2\nguid: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n```\n\nAutomatic GUID generation does not depend on time, so it is safe if autofix runs parallel.\n\u003c/details\u003e\n\n\u003cdt\u003eMissing meta files for some binaries\n\u003cdd\u003eSometimes you need to import auto-generated binary data files (like encoded as Protocol Buffer Binary Wire Format) programmatically. Then, autofix feature is useful because it can add meta files to the binaries.\n\u003cdetails\u003e\n\u003csummary\u003eExample of auto-generated meta files\u003c/summary\u003e\n\n```yaml\nguid: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nTextScriptImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n```\n\nAutomatic GUID generation does not depend on time, so it is safe if autofix runs parallel.\n\u003c/details\u003e\n\u003c/dl\u003e\n\n```console\n$ unity-meta-autofix -help\nusage: unity-meta-autofix [\u003coptions\u003e] \u003cpattern\u003e [\u003cpattern\u003e...]\n\nFix missing or dangling .meta. Currently autofix is only limited support.\n\nARGUMENTS\n  \u003cpattern\u003e\n        glob pattern to path where autofix allowed on\n\nOPTIONS\n  -debug\n        set log level to DEBUG (default INFO)\n  -dry-run\n        dry run\n  -root-dir string\n        directory path to where unity-meta-check checked at (default \".\")\n  -silent\n        set log level to WARN (default INFO)\n  -version\n        print version\n\nEXAMPLE USAGES\n  $ unity-meta-check \u003coptions\u003e | unity-meta-autofix -dry-run path/to/autofix\n  $ unity-meta-check \u003coptions\u003e | unity-meta-autofix \u003coptions\u003e | \u003cother-unity-meta-check-tool\u003e\n```\n\nCurrently, autofix for dangling meta files is not supported, because it might be dangerous on some situations.\n\n\n\n### unity-meta-check-junit\n\n`unity-meta-check-junit` is a reporter for Jenkins compatible XML based JUnit reports. It needs a result of `unity-meta-check` via stdin.\n\n```console\n$ unity-meta-check-junit -help\nusage: unity-meta-check-junit [\u003coptions\u003e] [\u003cpath\u003e]\n\nSave a JUnit report file for the result from unity-meta-check via STDIN.\n\n  \u003cpath\u003e\n        output path to write JUnit report\n\nOPTIONS\n  -version\n        print version\n\nEXAMPLE USAGES\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-junit path/to/junit-report.xml\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-junit path/to/junit-report.xml | \u003cother-unity-meta-check-tool\u003e\n```\n\n\n\n### unity-meta-check-github-pr-comment\n\n`unity-meta-check-github-pr-comment` is a reporter for GitHub comments of GitHub issues or pull requests. It needs a result of `unity-meta-check` via stdin.\n\n![](./docs/images/unity-meta-check-github-pr-comment-screenshot.png)\n\n```console\n$ unity-meta-check-github-pr-comment -help\nusage: unity-meta-check-github-pr-comment [\u003coptions\u003e]\n\nPost a comment for the result from unity-meta-check via STDIN to GitHub Pull Request.\n\nOPTIONS\n  -api-endpoint string\n        GitHub API endpoint URL (like https://github.example.com/api/v3) (default \"https://api.github.com\")\n  -debug\n        set log level to DEBUG (default INFO)\n  -lang string\n        language code (available: en, ja) (default \"en\")\n  -owner string\n        owner of the GitHub repository\n  -pull uint\n        pull request number\n  -repo string\n        name of the GitHub repository\n  -silent\n        set log level to WARN (default INFO)\n  -template-file string\n        custom template file\n  -version\n        print version\n\nENVIRONMENT\n  GITHUB_TOKEN\n        GitHub API token. The scope can be empty if your repository is public. Otherwise, the scope should contain \"repo\"\n\nEXAMPLE USAGES\n  $ export GITHUB_TOKEN=\"********\"\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-github-pr-comment \\\n      -api-endpoint https://api.github.com \\\n      -owner example-org \\\n      -repo my-repo \\\n      -pull \"$CIRCLE_PR_NUMBER\"  # This is for CircleCI\n\n  $ export GITHUB_TOKEN=\"********\"  # This should be set via credentials().\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-github-pr-comment \\\n      -api-endpoint https://github.example.com/api/v3 \\\n      -owner example-org \\\n      -repo my-repo \\\n      -pull \"$ghprbPullId\"  # This is for Jenkins with GitHub PullRequest Builder plugin\n\n  $ GITHUB_TOKEN=\"********\" unity-meta-check \u003coptions\u003e | unity-meta-check-junit path/to/unity-meta-check-result.xml | unity-meta-check-github-pr-comment \u003coptions\u003e | \u003cother-unity-meta-check-tool\u003e\n\n  $ export GITHUB_TOKEN=\"********\"  # This should be set via credentials().\n  $ unity-meta-check \u003coptions\u003e | unity-meta-check-github-pr-comment \\\n      -api-endpoint https://github.example.com/api/v3 \\\n      -owner example-org \\\n      -repo my-repo \\\n      -pull \"$ghprbPullId\" \\\n      -template-file path/to/template.json  # template file can be used for localization for GitHub comments.\n\nTEMPLATE FILE FORMAT EXAMPLE\n  If a template file is like:\n\n  {\n    \"success\": \"No missing/dangling .meta found. Perfect!\",\n    \"failure\": \"Some missing or dangling .meta found. Fix commits are needed.\",\n    \"header_status\": \"Status\",\n    \"header_file_path\": \"File\",\n    \"status_missing\": \"Not committed\",\n    \"status_dangling\": \"Not removed\"\n  }\n\n  then the output become:\n\n  No missing/dangling .meta found. Perfect!\n\n  or:\n\n  Some missing or dangling .meta found. Fix commits are needed.\n\n  | Status | File |\n  |:--|:--|\n  | Not committed | `path/to/missing.meta` |\n  | Not removed | `path/to/dangling.meta` |\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdena%2Funity-meta-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdena%2Funity-meta-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdena%2Funity-meta-check/lists"}