#!/bin/bash # Assuming all necessary environment variables like GITHUB_EVENT_PATH are correctly set # Function to calculate the second Tuesday of the given month and year # as the release day is always the 2nd Tuesday calculate_second_tuesday() { year=$1 month=$2 first_of_month="$year-$month-01" day_of_week=$(date -d "$first_of_month" "+%u") offset_to_first_tuesday=$(( (9 - day_of_week) % 7 )) first_tuesday=$(date -d "$first_of_month +$offset_to_first_tuesday days" "+%Y-%m-%d") # Calculate the second Tuesday by adding 7 days second_tuesday=$(date -d "$first_tuesday +7 days" "+%Y-%m-%d") echo $second_tuesday } # Set the initial values for version calculation initial_version_major=8 # Major version start initial_version_minor=8 # Minor version start initial_year=2024 initial_month=4 # April, for the 8.8.0 release # Assuming the script is run in or after 2024 current_year=$(date +%Y) # Get the current year # Calculate the number of versions to generate based on the current year additional_versions=$(( (current_year - 2024 + 1) * 12 )) # Versions to calculate versions_to_calculate=$additional_versions # Declare the associative array outside the loop declare -A MILESTONE_DATES for (( i=0; i> $GITHUB_ENV # Print the array in the desired format for display purposes echo "MILESTONE_DATES=(" for version in "${!MILESTONE_DATES[@]}"; do echo " [\"$version\"]=\"${MILESTONE_DATES[$version]}\"" done echo ")"