Skip to content

Commit

Permalink
Fix version updater script (#383)
Browse files Browse the repository at this point in the history
Explicitly match the full version variable name to avoid matching other
variables when updating the `defaults/main.yml` file.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ authored Jun 10, 2024
1 parent aeb7570 commit f003067
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/version_updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ esac
echo_green "New ${source_repo} version is: ${version}"

# Download destination repository
if grep "_version: ${version}" "roles/${role}/defaults/main.yml"; then
if grep -Eq "^${role}_version: ${version}" "roles/${role}/defaults/main.yml"; then
echo_green "Newest version is used."
exit 0
fi
sed -i "s/_version:.*$/_version: ${version}/" "roles/${role}/defaults/main.yml"
sed -i -r "s/_version.*[0-9]+\.[0-9]+\.[0-9]+/_version\` | ${version}/" "roles/${role}/README.md"
sed -i "s/^${role}_version:.*$/${role}_version: ${version}/" "roles/${role}/defaults/main.yml"
sed -i -r "s/${role}_version.*[0-9]+\.[0-9]+\.[0-9]+/${role}_version\` | ${version}/" "roles/${role}/README.md"
yq eval -i ".argument_specs.main.options.${role}_version.default = \"${version}\"" "roles/${role}/meta/argument_specs.yml"

update_branch="autoupdate/${role}/${version}"
Expand Down

0 comments on commit f003067

Please sign in to comment.