diff --git a/tools/tuf/releaser.sh b/tools/tuf/releaser.sh index b93dff6f2e..874b5a392a 100755 --- a/tools/tuf/releaser.sh +++ b/tools/tuf/releaser.sh @@ -149,7 +149,7 @@ update_osquery_schema_and_flags () { # 4. Commit and PR. git commit -m "Update osquery schemas and flags to $version" git push origin "$branch_name" - prompt "A PR will be created to trigger a Github Action to build osqueryd." + prompt "A PR will be created to update osquery schema and flags." gh pr create -f -B main -t "Update osquery schema and flags to $version" popd } @@ -419,19 +419,20 @@ elif [[ $ACTION == "release-to-production" ]]; then elif [[ $ACTION == "create-fleetd-release-pr" ]]; then create_fleetd_release_pr elif [[ $ACTION == "update-osquery-schema" ]]; then + pushd website # Strip leading 'v' from `node --version` and get major NODE_VERSION=$(node --version | sed 's/^v//') NODE_MAJOR=${NODE_VERSION%%.*} - EXPECTED_NODE_RANGE=$(jq -r '.engines.node' package.json) # Extract the first numeric sequence (major) from the range, e.g., 24 from "^24.10.0" EXPECTED_MAJOR=$(echo "$EXPECTED_NODE_RANGE" | sed -E 's/^[^0-9]*([0-9]+).*/\1/') - if [[ "$NODE_MAJOR" != "$EXPECTED_MAJOR" ]]; then echo "Your Node.js $NODE_VERSION does not satisfy engines.node ($EXPECTED_NODE_RANGE)." echo "Please use Node $EXPECTED_MAJOR.x (e.g., 24.10.0)." exit 1 fi + popd + update_osquery_schema_and_flags "$VERSION" else echo "Unsupported action: $ACTION"