Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fix version override when no `version-file` is specified in inputs
  • Loading branch information
StephenHodgson authored Aug 7, 2024
1 parent 6817b47 commit 5b05648
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
9 changes: 1 addition & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31191,14 +31191,7 @@ async function ValidateInputs() {
core.info(`versionFilePath:\n > "${versionFilePath}"`);
const [unityVersion, changeset] = await getUnityVersionFromFile(versionFilePath);
const versions = getUnityVersionsFromInput();
const pathInput = core.getInput('version-file');
const overrideVersion = pathInput && pathInput.length > 0 && versions.length > 0;
if (versions.length > 0) {
const version = versions.find(([v, c]) => v === unityVersion && c === changeset);
if (!version && !overrideVersion) {
versions.push([unityVersion, changeset]);
}
} else {
if (versions.length === 0) {
versions.push([unityVersion, changeset]);
}
versions.sort(([a], [b]) => semver.compare(a, b, true));
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unity-setup",
"version": "1.0.3",
"version": "1.0.4",
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
"author": "Buildalon",
"license": "MIT",
Expand Down
9 changes: 1 addition & 8 deletions src/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,7 @@ async function ValidateInputs() {
core.info(`versionFilePath:\n > "${versionFilePath}"`);
const [unityVersion, changeset] = await getUnityVersionFromFile(versionFilePath);
const versions = getUnityVersionsFromInput();
const pathInput = core.getInput('version-file');
const overrideVersion = pathInput && pathInput.length > 0 && versions.length > 0;
if (versions.length > 0) {
const version = versions.find(([v, c]) => v === unityVersion && c === changeset);
if (!version && !overrideVersion) {
versions.push([unityVersion, changeset]);
}
} else {
if (versions.length === 0) {
versions.push([unityVersion, changeset]);
}
versions.sort(([a], [b]) => semver.compare(a, b, true));
Expand Down

0 comments on commit 5b05648

Please sign in to comment.