Skip to content

Commit a249786

Browse files
committed
ci: expand |ncs_version_number| in compliance link checks
Read NCS version from west.yml during the added-links curl step so versioned links.txt URLs are probed with the actual NCS release number. Jira: NCSDK-39705 Signed-off-by: Bartosz Meus <bartosz.meus@nordicsemi.no>
1 parent 2e030e9 commit a249786

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/compliance.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,27 @@ jobs:
113113
grep "^+" || true | \
114114
grep -Ev "^(---|\+\+\+)" || true)
115115
116+
NCS_VERSION_NUMBER=$(python3 -c "
117+
import sys
118+
import west.manifest
119+
try:
120+
projects = west.manifest.Manifest.from_topdir().get_projects(['nrf'])
121+
if not projects or not projects[0].revision:
122+
raise RuntimeError('nrf project missing or has no revision')
123+
rev = projects[0].revision
124+
print(rev[1:] if rev.startswith('v') else rev)
125+
except Exception as e:
126+
print(f'::error ::Could not determine NCS version from west manifest: {e}', file=sys.stderr)
127+
sys.exit(1)
128+
")
129+
130+
echo "Resolved NCS version from manifest: ${NCS_VERSION_NUMBER}"
131+
116132
while IFS= read -r link; do
117133
if [[ $link =~ $RE ]]; then
118134
NAME=${BASH_REMATCH[1]}
119135
URL=${BASH_REMATCH[2]}
136+
URL="${URL//|ncs_version_number|/${NCS_VERSION_NUMBER}}"
120137
121138
echo -n "Checking URL for '$NAME' ($URL)... "
122139
if [[ "$URL" == *"files.nordicsemi.com"* ]]; then

0 commit comments

Comments
 (0)