File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828 steps :
2929 - name : Checkout repository
30- uses : actions/checkout@v5
30+ uses : actions/checkout@v6
3131
3232 - name : Prepare local CodeQL model packs
3333 run : |
9292
9393 - name : Upload sarif change
9494 if : steps.validate.outcome != 'success'
95- uses : actions/upload-artifact@v5
95+ uses : actions/upload-artifact@v6
9696 with :
9797 name : sarif
9898 path : |
Original file line number Diff line number Diff line change @@ -167,9 +167,10 @@ jobs:
167167
168168 # Stage version-bearing files and lockfile changes
169169 git add -A
170- # Ensure CodeQL- generated artifacts are not staged for commit
170+ # Ensure generated artifacts (CodeQL, CAP compilation) are not staged for commit
171171 git restore --staged .codeql || true
172172 git restore --staged '*.qlx' || true
173+ git restore --staged 'javascript/frameworks/cap/test/**/model.cds.json' || true
173174
174175 # Check if there are changes to commit
175176 if git diff --cached --quiet; then
Original file line number Diff line number Diff line change 7373* .cds.json
7474.cds-extractor-cache
7575
76+ # CodeQL-generated artifacts
77+ .codeql /
78+ * .qlx
79+
Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ collect_versions() {
106106 if [[ -f " ${full_path} " ]]; then
107107 local pack_version
108108 pack_version=$( grep -m1 " ^version:" " ${full_path} " | awk ' {print $2}' )
109+ if [[ -z " ${pack_version} " ]]; then
110+ echo " ERROR: ${qlpack_file} is missing a 'version:' field" >&2
111+ return 1
112+ fi
109113 versions+=(" ${qlpack_file} |${pack_version} " )
110114 else
111115 echo " WARNING: ${qlpack_file} not found" >&2
@@ -191,12 +195,16 @@ update_internal_deps() {
191195 local old_version=" $2 "
192196 local new_version=" $3 "
193197
198+ # Escape regex metacharacters in the old version (e.g., '.' -> '\.')
199+ local escaped_old_version
200+ escaped_old_version=$( printf ' %s' " ${old_version} " | sed ' s/[.\*\[\^\$]/\\&/g' )
201+
194202 for pack_name in " ${INTERNAL_PACKS[@]} " ; do
195203 # Update quoted caret-prefixed versions: "^X.Y.Z"
196- sed -i.bak " s|${pack_name} : \"\\ ^${old_version } \" |${pack_name} : \" ^${new_version} \" |g" " ${file} "
204+ sed -i.bak " s|${pack_name} : \"\\ ^${escaped_old_version } \" |${pack_name} : \" ^${new_version} \" |g" " ${file} "
197205 rm -f " ${file} .bak"
198206 # Update unquoted exact versions: X.Y.Z
199- sed -i.bak " s|${pack_name} : ${old_version } $|${pack_name} : ${new_version} |g" " ${file} "
207+ sed -i.bak " s|${pack_name} : ${escaped_old_version } $|${pack_name} : ${new_version} |g" " ${file} "
200208 rm -f " ${file} .bak"
201209 done
202210}
You can’t perform that action at this time.
0 commit comments