Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 62ba3ce

Browse files
committed
Use semver to compare versions
1 parent 73e12dc commit 62ba3ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cache-extract-entries.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import fs from 'fs'
33
import crypto from 'crypto'
44
import * as core from '@actions/core'
55
import * as glob from '@actions/glob'
6+
import * as semver from 'semver'
67

78
import * as params from './input-params'
89

@@ -436,8 +437,13 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
436437
configCachePath,
437438
true
438439
).withNonUniqueFileNames()
439-
if (pathResults.find(result => !result.gradleVersion.startsWith('8.6'))) {
440-
definition.notCacheableBecause('NOT GRADLE 8.6')
440+
if (
441+
pathResults.find(result => {
442+
const gradleVersion = semver.coerce(result.gradleVersion)
443+
return gradleVersion && semver.lt(gradleVersion, '8.6.0')
444+
})
445+
) {
446+
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+')
441447
}
442448
return definition
443449
})

0 commit comments

Comments
 (0)