Skip to content

Commit f32dba1

Browse files
authored
Update Projection Check to Allow Variants (#181)
* ci.yml: Update `DEP_VER` to be a capture group rather than a split This is because we may have optional variants after the @git.VERSION * Double slash escaped the '.' in capture function
1 parent a29d380 commit f32dba1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ jobs:
175175
for DEP in $DEPS; do
176176
DEP_VER=''
177177
if [[ "$DEP" == "${{ needs.defaults.outputs.root-sbd }}" ]]; then
178-
DEP_VER=$(yq '.spack.specs[0] | split("@git.") | .[1]' spack.yaml)
178+
# The model version is the bit after '@git.', before any later, space-separated, optional variants.
179+
# For example, in '[email protected] type=ACCESS ~debug' the version is 'VERSION'.
180+
DEP_VER=$(yq '.spack.specs[0] | capture(".+@git\\.(?<version>[^ ]+).*") | .version' spack.yaml)
179181
else
180182
# Capture the section after '@git.' or '@' (if it's not a git-attributed version) and before a possible '=' for a given dependency.
181183
# Ex. '@git.2024.02.11' -> '2024.02.11', '@access-esm1.5' -> 'access-esm1.5', '@git.2024.05.21=access-esm1.5' -> '2024.05.21'

0 commit comments

Comments
 (0)