Skip to content

Commit

Permalink
Use semver to compare versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz committed Dec 23, 2023
1 parent 73e12dc commit af6e3f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cache-extract-entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import fs from 'fs'
import crypto from 'crypto'
import * as core from '@actions/core'
import * as glob from '@actions/glob'
import * as semver from 'semver'

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

Expand Down Expand Up @@ -436,8 +437,12 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
configCachePath,
true
).withNonUniqueFileNames()
if (pathResults.find(result => !result.gradleVersion.startsWith('8.6'))) {
definition.notCacheableBecause('NOT GRADLE 8.6')
if (
pathResults.find(result => {
return semver.lt(result.gradleVersion, '8.6', true)
})
) {
definition.notCacheableBecause('Configuration cache data only saved for Gradle 8.6+')
}
return definition
})
Expand Down

0 comments on commit af6e3f2

Please sign in to comment.