[FR] Reset deprecated lock to the latest state during lock (#5827)
This commit is contained in:
committed by
GitHub
parent
d74c83140b
commit
49c9c283e6
@@ -4,13 +4,24 @@ set -e
|
||||
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
# switch to
|
||||
for BRANCH in $(echo $@ | sed "s/,/ /g")
|
||||
BRANCHES=($(echo "$@" | sed "s/,/ /g" | tr ' ' '\n' | sort -V))
|
||||
LAST_INDEX=$((${#BRANCHES[@]} - 1))
|
||||
|
||||
for i in "${!BRANCHES[@]}"
|
||||
do
|
||||
BRANCH=${BRANCHES[$i]}
|
||||
echo $BRANCH
|
||||
git checkout $BRANCH
|
||||
git pull
|
||||
python -m detection_rules dev build-release --update-version-lock
|
||||
|
||||
# Reset deprecated_rules.json after all branches except the last to prevent
|
||||
# branch-specific deprecations from leaking across checkouts (e.g. D4C rules
|
||||
# deprecated on 8.19 but active on 9.3+). The last branch is closest to main
|
||||
# and carries the correct deprecation state forward.
|
||||
if [ $i -lt $LAST_INDEX ]; then
|
||||
git checkout -- detection_rules/etc/deprecated_rules.json
|
||||
fi
|
||||
done
|
||||
|
||||
git checkout ${CURRENT_BRANCH}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "detection_rules"
|
||||
version = "1.6.1"
|
||||
version = "1.6.2"
|
||||
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
||||
Reference in New Issue
Block a user