Skip to content

Commit

Permalink
Merge pull request #3065 from Blargian/fix_blank_changelog
Browse files Browse the repository at this point in the history
update changelog to reference previous year if blank
  • Loading branch information
Blargian authored Jan 10, 2025
2 parents faf9323 + 40ee8e7 commit 142fe79
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions copyClickhouseRepoDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ echo "[$SCRIPT_NAME] Start tasks for copying docs from ClickHouse repo"

# Clone ClickHouse repo
echo "[$SCRIPT_NAME] Start cloning ClickHouse repo"
git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git
git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git temp
cp -r temp/ ClickHouse/
rm -rf temp
echo "[$SCRIPT_NAME] Cloning completed"

# Copy docs folders from ClickHouse repo to docs folder
Expand Down Expand Up @@ -34,12 +36,15 @@ if grep -q '^# $(date +%Y) Changelog' ClickHouse/CHANGELOG.md; then
rm temp.txt
echo "$(date +%Y) Changelog was updated."
else
echo "No Changelog found for present year."
current_year="$(date +%Y)"
previous_year="$(($current_year - 1))"
echo "No Changelog found for $current_year."
echo -e ":::note\nThere have been no new releases yet for $current_year. \n View changelog for the year [$previous_year](/docs/en/whats-new/changelog/$previous_year).\n:::" >> docs/en/whats-new/changelog/index.md
fi

# Delete ClickHouse repo
echo "[$SCRIPT_NAME] Start deleting ClickHouse repo"
rm -r ClickHouse
rm -rf ClickHouse
echo "[$SCRIPT_NAME] Deleting ClickHouse repo completed"

echo "[$SCRIPT_NAME] Finish tasks for copying docs from ClickHouse repo"

0 comments on commit 142fe79

Please sign in to comment.