diff --git a/entry b/entry index b9b90a8..2113e09 100755 --- a/entry +++ b/entry @@ -140233,7 +140233,7 @@ function validateCompatibility(payloadVersion, actionVersion) { const major = payloadSemVer.major; const minor = payloadSemVer.minor; const patch = payloadSemVer.patch; - const compatibilityRange = COMPATIBILITY_POLICY === "same-features" ? `^${major}.${minor}.${major === 0 ? patch : 0}` : `^${major}.${major === 0 ? minor : 0}.0`; + const compatibilityRange = COMPATIBILITY_POLICY === "same-features" ? `^${major}.${minor}.${major === 0 ? patch : 0}` : `^${major}.${major === 0 ? minor : 0}.${major === 0 ? "x" : 0}`; if (!import_semver.default.satisfies(actionVersion, compatibilityRange)) { throw new Error( `Payload version ${payloadVersion} is incompatible with action version ${actionVersion}. Please update your workflow to use at least ${import_semver.default.minVersion(compatibilityRange)} version of the action.` diff --git a/utils/versioning.test.ts b/utils/versioning.test.ts index 15e7f72..51ffdd9 100644 --- a/utils/versioning.test.ts +++ b/utils/versioning.test.ts @@ -10,6 +10,9 @@ describe('validateCompatibility', () => { ["1.0.0", "1.0.0"], // same ["1.0.0-alpha.1", "1.0.0"], // action is newer than pre-release ["0.1.0", "0.1.1"], // action is newer during active development + ["0.0.158", "0.0.158"], // bug #129 + ["0.0.159", "0.0.158"], // bug #129 + ["0.0.158", "0.0.159"], // bug #129 ["1.0.0", "1.0.1"], // action patched ["1.0.0", "1.1.0"], // action has a new feature (backward compatible) ["1.0.1", "1.0.0"], // payload is newer (patch) diff --git a/utils/versioning.ts b/utils/versioning.ts index 9874141..5e35f8d 100644 --- a/utils/versioning.ts +++ b/utils/versioning.ts @@ -31,7 +31,7 @@ export function validateCompatibility(payloadVersion: string, actionVersion: str const compatibilityRange = COMPATIBILITY_POLICY === 'same-features' ? `^${major}.${minor}.${major === 0 ? patch : 0}` - : `^${major}.${major === 0 ? minor : 0}.0`; // non-breaking + : `^${major}.${major === 0 ? minor : 0}.${major === 0 ? "x" : 0}`; // non-breaking if (!semver.satisfies(actionVersion, compatibilityRange)) { throw new Error(