GDResChecker is a tool for Godot resource existence checking which path specified in Scene(.tscn) files and Script(C#) files.
dotnet tool install --global YetAnotherAI.Godot.ResourceChecker.Console
check-godot-resource /path/to/your/godot/project
Add this step to your action workflows.
steps:
- use: yet-another-ai/GDResChecker/action@main
with:
project: /path/to/your/godot/project
Example:
check:resources:
image: mcr.microsoft.com/dotnet/sdk:8.0
script:
- dotnet tool install -g YetAnotherAI.Godot.ResourceChecker.Console
- export PATH="$PATH:/root/.dotnet/tools"
- check-godot-resource /path/to/your/godot/project
- Collect all files path in your project directories recursively.
- Read scene file, find external resource definition like
[ext_resource path="res://a.glb"]
, then check if all files path contains this path. - Read C# file, use
Microsoft.CodeAnalysis.CSharp
package to travel syntax tree, find string literal expression which starts withres://
, then check if all files path contains this path. - If resource not exists, this tool will print all non-exists resource path then exit with code 1. If all resources exist, the tool will exit with code 0.