{"id":21195271,"url":"https://github.com/szapp/patch-validator","last_synced_at":"2026-05-20T02:51:11.389Z","repository":{"id":232243277,"uuid":"783322733","full_name":"szapp/patch-validator","owner":"szapp","description":"GitHub action that checks Daedalus script symbols and resource file names in a Gothic VDF patch for validity and general compatibility","archived":false,"fork":false,"pushed_at":"2025-01-11T10:37:49.000Z","size":9699,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T14:14:41.151Z","etag":null,"topics":["checks","ci","daedalus","github-actions","gothic","gothic1","gothic2","modding-gothic","naming-conventions","ninja"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/vdf-patch-validator","language":"TypeScript","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/szapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"szapp"}},"created_at":"2024-04-07T15:16:03.000Z","updated_at":"2025-01-11T10:37:53.000Z","dependencies_parsed_at":"2024-04-11T18:41:51.078Z","dependency_job_id":"ff54db32-d108-42cb-b717-93060e8119ad","html_url":"https://github.com/szapp/patch-validator","commit_stats":null,"previous_names":["szapp/patch-validator"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szapp%2Fpatch-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szapp%2Fpatch-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szapp%2Fpatch-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szapp%2Fpatch-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szapp","download_url":"https://codeload.github.com/szapp/patch-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243652603,"owners_count":20325590,"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":["checks","ci","daedalus","github-actions","gothic","gothic1","gothic2","modding-gothic","naming-conventions","ninja"],"created_at":"2024-11-20T19:26:56.432Z","updated_at":"2026-05-20T02:51:11.384Z","avatar_url":"https://github.com/szapp.png","language":"TypeScript","funding_links":["https://ko-fi.com/szapp"],"categories":[],"sub_categories":[],"readme":"# Patch Validator\n\n[![CI](https://github.com/szapp/patch-validator/actions/workflows/ci.yml/badge.svg)](https://github.com/szapp/patch-validator/actions/workflows/ci.yml)\n[![Coverage](badges/coverage.svg)](https://github.com/szapp/patch-validator/actions/workflows/ci.yml)\n[![Marketplace](https://img.shields.io/github/v/release/szapp/patch-validator?logo=githubactions\u0026logoColor=white\u0026label=marketplace)](https://github.com/marketplace/actions/vdf-patch-validator)\n\nGitHub action for checking if Daedalus script symbols and resource files in a Gothic VDF patch adhere to the [naming conventions](https://github.com/szapp/Ninja/wiki/Inject-Changes#naming-conventions), if all symbol references are valid, and that no vital symbols are overwritten. This allows to determine the general compatibility of a patch.\n\nThe action collects symbol tables of all Daedalus parsers (e.g. content, menu, etc.) and walks through the resource file tree (i.e. everything under \"\\_work/Data\"). For symbols, symbol references, and resource file names that violate the compatibility assurances, the action fails with code annotations. This GitHub action is useful for CI of Gothic VDF patches that include Daedalus code and/or resource files.\n\n\u003e [!Important]\n\u003e This action does not check the integrity of the scripts (i.e. no syntax or type checks). Do not mistake valid scripts for sound code. Please refer to additional packages for that, e.g. [Parsiphae](https://github.com/szapp/parsiphae-action).\n\n## Usage\n\nCreate a new GitHub Actions workflow in your project, e.g. at `.github/workflows/validation.yml`.\nThe content of the file should be in the following format:\n\n```yaml\nname: validation\n\n# Trigger workflow on push events with changes in SRC or D files\non:\n  push:\n    paths:\n      - '**.src'\n      - '**.SRC'\n      - '**.Src'\n      - '**.d'\n      - '**.D'\n      - '**/_work/Data/**/*'\n\n# These permissions are necessary for creating the check runs\npermissions:\n  contents: read\n  checks: write\n\n# The checkout action needs to be run first\njobs:\n  patch-validator:\n    name: Run validator on scripts\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - name: Check for validity\n        uses: szapp/patch-validator@v1\n        with:\n          patchName: # Optional (see below)\n          rootPath: # Optional\n          token: # Optional\n```\n\n## Configuration\n\n- `patchName`:\n  Identifier of the patch, i.e. the VDF name.  \n  Defaults to the repository name.\n\n- `rootPath`:\n  The path to the patch root, i.e. where the Ninja directory and `.validator.yml` (see below) are.  \n  Defaults to the repository root.\n\n- `token`:\n  The `GITHUB_TOKEN` to [authenticate on behalf of GitHub Actions](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow).  \n  Defaults to the GitHub token, i.e. checks are created by the GitHub Actions bot.\n\nAdditionally, place a file named `.validator.yml` in `rootPath` of your repository with the following content.\nAll settings are optional, but the file must exist (even if empty).\n\n- `prefix`:\n  One or several additional short descriptors that prefix global symbol names. By default the `patchName` and `PATCH_` + `patchName` are expected symbol prefixes, e.g. `MyWork` and `Patch_MyWork`.  \n  May either be blank, a string or a YAML list of strings\n\n- `ignore-declaration`:\n  One or several symbols names that intentionally overwrite common symbols.  \n  May either be blank, a string or a YAML list of strings\n\n- `ignore-resource`:\n  One or several resource file paths that intentionally overwrite existing textures, meshes, worlds, animations, sounds, or presets. The paths are case-insensitive and glob pattern wildcards are supported.\n  May either be blank, a string or a YAML list of strings\n\nExample content:\n\n```yaml\nprefix: FOA # Either a single entry\nignore-declaration:\n  - DIA_NONE_9022_KALIF # Or a YAML list\n  - B_SomeFunction\nignore-resource:\n  - '_work/Data/Textures/_compiled/Overwrite-C.TEX'\n  - '_work/Data/Sounds/SFX/Hero*.WAV'\n```\n\n## Remove second commit status check\n\nThe way GitHub check suites are designed, there will be two check statuses attached to a commit when using the 'push' event trigger.\nOne check status is the actual check run containing the error report and line annotations, the second one is the workflow run.\nUnfortunately, the creation of the superfluous workflow check status cannot be suppressed.\n\nOne workaround is to delete the entire workflow after the checks have been performed, effectively removing the check status from the commit.\nHowever, this is not possible with the default `GITHUB_TOKEN`, to avoid recursive workflow runs.\nTo remove the additional status check, call this GitHub Action with an authentication `token` of a GitHub App and enable the `check_run` event with `completed` (see below).\nFor more details the issue, see [here](https://github.com/peter-murray/workflow-application-token-action#readme).\nAlways leave the additional input `cleanup-token` at its default.\n\n\u003e [!Tip]\n\u003e This is only an optional cosmetic enhancement and this GitHub action works fine without.\n\n```yaml\nname: validation\n\non:\n  push:\n    paths:\n      - '**.src'\n      - '**.SRC'\n      - '**.Src'\n      - '**.d'\n      - '**.D'\n      - '**/_work/Data/**/*'\n  check_run:\n    types: completed\n\npermissions:\n  contents: read\n  checks: write\n  actions: write\n\njobs:\n  patch-validator:\n    name: Run validator on scripts\n    if: github.event_name != 'check_run' || github.event.check_run.external_id == github.workflow\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/create-github-app-token@v1\n        id: app-token\n        with:\n          app-id: ${{ vars.APP_ID }} # GitHub App ID\n          private-key: ${{ secrets.APP_KEY }} # GitHub App private key\n      - uses: actions/checkout@v6\n      - name: Check for validity\n        uses: szapp/patch-validator@v1\n        with:\n          patchName: # Optional (see below)\n          rootPath: # Optional\n          token: ${{ steps.app-token.outputs.token }}\n```\n\n\u003e [!Note]\n\u003e This procedure only works reasonably well if `patch-validator` is only called once in the workflow file.\n\n## Development\n\nThis project uses automatic linting, formatting, and tests.\n\nBefore setting up the dependencies with `npm ci`, an installation of Java is required for `antlr4ng-cli`.  \nThe correct versions are best installed with [`antlr4-tools`](https://github.com/antlr/antlr4-tools).\nIn brief, run the following commands within a Python 3 installation/environment.\n\n```bash\npip install antlr4-tools\nantlr4\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszapp%2Fpatch-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszapp%2Fpatch-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszapp%2Fpatch-validator/lists"}