Skip to content

[BUG] Builder workflow not detecting the previous version #1040

@Jorgesnchz

Description

@Jorgesnchz

Describe the bug
The builder workflows are failing and the reason why they are failing is the query to get the new value of the previous version:

CURRENT="$(bash build-scripts/product_version.sh)"
PREVIOUS=$(curl -s https://api.github.com/repos/wazuh/wazuh-indexer/releases | jq -r '.[].tag_name' | grep -vE 'alpha|beta|rc' | sed 's/^v//' | grep -E '^4\.[0-9]+\.[0-9]+$' | \
grep -v "^${CURRENT}$" | sort -V | awk -v current="$CURRENT" '$0 < current' | tail -n1)

echo "Current version: $CURRENT"
echo "Latest release detected: $PREVIOUS"
echo "previous_version=$PREVIOUS" >> $GITHUB_OUTPUT

Output:

CURRENT="$(bash build-scripts/product_version.sh)"
PREVIOUS=$(curl -s https://api.github.com/repos/wazuh/wazuh-indexer/releases | jq -r '.[].tag_name' | grep -vE 'alpha|beta|rc' | sed 's/^v//' | grep -E '^4\.[0-9]+\.[0-9]+$' | \
grep -v "^${CURRENT}$" | sort -V | awk -v current="$CURRENT" '$0 < current' | tail -n1)

echo "Current version: $CURRENT"
echo "Latest release detected: $PREVIOUS"
echo "previous_version=$PREVIOUS" >> $GITHUB_OUTPUT
shell: /usr/bin/bash -e {0}
jq: error (at <stdin>:1): Cannot index string with string "tag_name"
Current version: 5.0.0
Latest release detected: 

Error:

Run sudo bash build-scripts/indexer_node_install.sh 
Error: Version argument is required.
Error: Process completed with exit code 1.

Also, it was detected that the previous version in the Debian test is still 4.12.0 which should be substituted by 5.0.0

To Reproduce
Steps to reproduce the behavior:

  1. See workflow run

Expected behavior

  • The expected previous version should be 5.0.0
  • Investigate the reason why the query sometimes fails

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Pending final review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions