Fix usage of version `latest` not matching internal elements (#298)

a54aa91 · Benjamin Schultzer · 2024-07-17 20:57

2 files +6 -2

Files changed

modified dist/index.js
+3 −1
@@ -9536,6 +9536,8 @@ function getVersionFromSpec(spec0, versions0) {
9536 9536 // If `version-type: strict` or version is RC, we obtain it directly
9537 9537 version = versions0[spec]
9538 9538 }
9539 + } else if (spec0 === 'latest') {
9540 + version = versions0[versions0.latest]
9539 9541 } else if (rangeMax !== null) {
9540 9542 // Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
9541 9543 const thatVersion = spec
@@ -9604,7 +9606,7 @@ function isRC(ver) {
9604 9606 }
9605 9607
9606 9608 function isKnownBranch(ver) {
9607 return ['main', 'master', 'maint', 'latest'].includes(ver)
9609 + return ['main', 'master', 'maint'].includes(ver)
9608 9610 }
9609 9611
9610 9612 function githubARMRunnerArchs() {
modified src/setup-beam.js
+3 −1
@@ -436,6 +436,8 @@ function getVersionFromSpec(spec0, versions0) {
436 436 // If `version-type: strict` or version is RC, we obtain it directly
437 437 version = versions0[spec]
438 438 }
439 + } else if (spec0 === 'latest') {
440 + version = versions0[versions0.latest]
439 441 } else if (rangeMax !== null) {
440 442 // Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
441 443 const thatVersion = spec
@@ -504,7 +506,7 @@ function isRC(ver) {
504 506 }
505 507
506 508 function isKnownBranch(ver) {
507 return ['main', 'master', 'maint', 'latest'].includes(ver)
509 + return ['main', 'master', 'maint'].includes(ver)
508 510 }
509 511
510 512 function githubARMRunnerArchs() {

Parents: 168876b