Fix ULF detection in Claude licensing (#569)

Detect ULF by Signature before entitlement XML and log license source for debugging.
main
dsarno 2026-01-15 13:34:50 -08:00 committed by GitHub
parent a4f74dab43
commit 1ab0fd4ba4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 6 deletions

View File

@ -97,16 +97,20 @@ jobs:
printf "%s" "$UNITY_LICENSE" > "$f" printf "%s" "$UNITY_LICENSE" > "$f"
fi fi
chmod 600 "$f" || true chmod 600 "$f" || true
# If someone pasted an entitlement XML into UNITY_LICENSE by mistake, re-home it: # Detect ULF first; it is XML and includes a <Signature> element.
if head -c 100 "$f" | grep -qi '<\?xml'; then if grep -qi '<Signature>' "$f"; then
mkdir -p "$RUNNER_TEMP/unity-config/Unity/licenses"
mv "$f" "$RUNNER_TEMP/unity-config/Unity/licenses/UnityEntitlementLicense.xml"
echo "ok=false" >> "$GITHUB_OUTPUT"
elif grep -qi '<Signature>' "$f"; then
# provide it in the standard local-share path too # provide it in the standard local-share path too
cp -f "$f" "$RUNNER_TEMP/unity-local/Unity/Unity_lic.ulf" cp -f "$f" "$RUNNER_TEMP/unity-local/Unity/Unity_lic.ulf"
echo "License source: ULF (Signature found)"
echo "ok=true" >> "$GITHUB_OUTPUT" echo "ok=true" >> "$GITHUB_OUTPUT"
# If someone pasted an entitlement XML into UNITY_LICENSE by mistake, re-home it:
elif grep -qi 'Entitlement|entitlement' "$f"; then
mkdir -p "$RUNNER_TEMP/unity-config/Unity/licenses"
mv "$f" "$RUNNER_TEMP/unity-config/Unity/licenses/UnityEntitlementLicense.xml"
echo "License source: Entitlement XML (re-homed)"
echo "ok=false" >> "$GITHUB_OUTPUT"
else else
echo "License source: Unknown format (no ULF Signature or Entitlement markers)"
echo "ok=false" >> "$GITHUB_OUTPUT" echo "ok=false" >> "$GITHUB_OUTPUT"
fi fi