Skip to content

Fixing Unity 6 Support in unity-activate and compiled action bundle.#109

Merged
webbertakken merged 2 commits intogame-ci:mainfrom
NicolasChicunque:main
Feb 24, 2026
Merged

Fixing Unity 6 Support in unity-activate and compiled action bundle.#109
webbertakken merged 2 commits intogame-ci:mainfrom
NicolasChicunque:main

Conversation

@NicolasChicunque
Copy link
Contributor

@NicolasChicunque NicolasChicunque commented Feb 21, 2026

https://github.com/NicolasChicunque/unity-activate

Summary: Fixing Unity 6 Support in unity-activate

Problem

The game-ci/unity-activate@v2 action fails with an Invalid version "6000.x.xf1" error because its internal Regex only supports versions starting with "20".

Solution

I created a fork and manually updated the version validation logic to include the 6000 series (Unity 6).

Step 1: Code Modification

Locate the file src/model/image-tag.ts and update the versionPattern() Regex to accept both 2000 and 6000 series.

Modified Regex in src/model/image-tag.ts

static get versionPattern() {
    return /^(20|60)\d{2}\.\d\.\w{3,4}|3$/;
}

Step 2: Compiling the Bundle

Since GitHub Actions run from the dist/ folder, editing the .ts file is not enough. I used @vercel/ncc to compile the final bundle, bypassing TypeScript type errors caused by the environment.

Compilation Command

npx @vercel/ncc build src/index.ts -o dist --license licenses.txt

Step 3: Deployment

Commit the updated dist/index.js file. If the repository has strict linting/formatting hooks (Husky/Prettier) that prevent the commit, use the --no-verify flag.

Git Commands

git add dist/index.js
git commit -m "Fix: Support Unity 6000 versioning" --no-verify
git push origin main

Step 4: Workflow Update

Finally, point the .yml file to the fixed fork and branch. Ensure the Unity version used has a corresponding Docker image available.

Workflow YAML

- name: Unity Activation
  uses: NicolasChicunque/unity-activate@main
  with:
    unityVersion: 6000.0.0f1

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced version detection to recognize additional Unity release formats, improving compatibility with a broader range of releases.

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

📝 Walkthrough

Walkthrough

Updated the version pattern regex in src/model/image-tag.ts to recognize Unity versions starting with 60 in addition to the existing 20 format. The pattern change from /^20\d{2}\.\d\.\w{3,4}|3$/ to /^(20|60)\d{2}\.\d\.\w{3,4}|3$/ broadens version string validation without modifying downstream logic.

Changes

Cohort / File(s) Summary
Version Pattern Update
src/model/image-tag.ts
Modified versionPattern regex to accept Unity versions starting with 60 alongside existing 20-prefixed versions, enabling support for Unity 6000+ releases.

Possibly related issues

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 Hop, hop, the regex hops along,
Twenty became twenty, sixty made it strong,
Unity versions now dance with glee,
6000 and beyond, wild and free!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides detailed context about the problem, solution, code changes, and deployment steps, but does not follow the required template structure with explicit 'Changes' and 'Checklist' sections. Restructure the description to follow the template with a 'Changes' section listing modifications and a 'Checklist' section with required items checked off.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating version pattern support to include Unity 6 (6000 series) in the unity-activate action.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/model/image-tag.ts`:
- Around line 29-31: The regex returned by static get versionPattern currently
has an unanchored alternation (the trailing "|3$" applies only to the right-hand
side) — update versionPattern so the start (^) and end ($) anchors apply to the
entire alternation by grouping the alternatives (e.g., wrap the two alternatives
in a single group or non-capturing group) and place ^ and $ around that group;
if the literal "3" was intended as a valid full-match alternative, include it
inside the grouped alternation, otherwise remove the stray "|3" alternative.

Comment on lines 29 to 31
static get versionPattern() {
return /^20\d{2}\.\d\.\w{3,4}|3$/;
return /^(20|60)\d{2}\.\d\.\w{3,4}|3$/;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix broken regex alternation — |3$ creates an unanchored and overly permissive pattern

The | operator has the lowest precedence of all regex operators — it splits the entire expression into everything to its left and everything to its right. The current regex:

/^(20|60)\d{2}\.\d\.\w{3,4}|3$/

is parsed as two independent alternatives:

  • ^(20|60)\d{2}\.\d\.\w{3,4}no trailing $, so "6000.0.0f1GARBAGE" passes
  • 3$ — any string ending in 3 passes (e.g., "notaversion3", "2023")

This was a latent bug in the original regex (/^20\d{2}\.\d\.\w{3,4}|3$/) that this PR carries forward. This is the classic pitfall where ^hello|goodbye$ doesn't require the full string to match either word — because | is evaluated last, after ^ and $.

The |3$ fragment appears unintentional. The fix is to wrap both anchors around the full expression:

🐛 Proposed fix
-    return /^(20|60)\d{2}\.\d\.\w{3,4}|3$/;
+    return /^(20|60)\d{2}\.\d\.\w{3,4}$/;

If the |3 was intentional (e.g., to also accept a bare "3"), use grouping to scope the alternation correctly:

-    return /^(20|60)\d{2}\.\d\.\w{3,4}|3$/;
+    return /^((20|60)\d{2}\.\d\.\w{3,4}|3)$/;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
static get versionPattern() {
return /^20\d{2}\.\d\.\w{3,4}|3$/;
return /^(20|60)\d{2}\.\d\.\w{3,4}|3$/;
}
static get versionPattern() {
return /^(20|60)\d{2}\.\d\.\w{3,4}$/;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/model/image-tag.ts` around lines 29 - 31, The regex returned by static
get versionPattern currently has an unanchored alternation (the trailing "|3$"
applies only to the right-hand side) — update versionPattern so the start (^)
and end ($) anchors apply to the entire alternation by grouping the alternatives
(e.g., wrap the two alternatives in a single group or non-capturing group) and
place ^ and $ around that group; if the literal "3" was intended as a valid
full-match alternative, include it inside the grouped alternation, otherwise
remove the stray "|3" alternative.

@NicolasChicunque
Copy link
Contributor Author

Thanks. Gracias.

@webbertakken webbertakken merged commit fbbebcb into game-ci:main Feb 24, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants