mirror of
https://github.com/TRaSH-Guides/Guides.git
synced 2026-02-05 00:09:14 -06:00
feat(ci): automatic changelog (#2005)
* chore(changelog): automatic changelog * fix(ci): multiple commits causing issues * fix(ci): spelling * fix(ci): don't force push
This commit is contained in:
20
.github/scripts/update-changelog.sh
vendored
Normal file
20
.github/scripts/update-changelog.sh
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
log_file="$1"
|
||||
output_file="docs/updates.txt"
|
||||
current_time=$(date +"%F %H:%M")
|
||||
formatted_output="# $current_time"
|
||||
|
||||
while IFS= read -r message; do
|
||||
pr_number=$(echo "$message" | grep -oE '\(#[0-9]+\)$' | tr -d '(#)')
|
||||
formatted_message=$(echo "$message" | sed -E 's/ \(#[0-9]+\)$//')
|
||||
formatted_output+="
|
||||
- [$formatted_message](https://github.com/TRaSH-Guides/Guides/pull/${pr_number})"
|
||||
done < "$log_file"
|
||||
|
||||
formatted_output+="\n"
|
||||
|
||||
{
|
||||
echo -e "$formatted_output"
|
||||
cat "$output_file"
|
||||
} > "${output_file}.tmp" && mv "${output_file}.tmp" "$output_file"
|
||||
Reference in New Issue
Block a user