Skip to content

A self-hosted media server and file management system

fix(ci): changelog tries to run hash values

aminnausin99bfb461bea5
diff --git a/.github/workflows/generate-changelog.yml b/.github/workflows/generate-changelog.yml
index c64386d7..651addc4 100644
--- a/.github/workflows/generate-changelog.yml
+++ b/.github/workflows/generate-changelog.yml
@@ -91,34 +91,39 @@ jobs:
# if there are matches, write out with scope under the title
if [ -n "$MATCHES" ]; then
- echo "### $TITLE" >> $CHANGELOG_FILE
- echo "" >> $CHANGELOG_FILE
+ echo "### $TITLE" >> $CHANGELOG_FILE
+ echo "" >> $CHANGELOG_FILE
- printf "%s\n" "$MATCHES" | while IFS=$'\t' read -r msg hash; do
- if echo "$msg" | grep -Eq '^[a-zA-Z_]+!?\\([^)]+\\):'; then
- scope=$(echo "$msg" | sed -nE 's/^[a-zA-Z_]+!?\(([^)]+)\).*/\1/p')
- scope="**$scope:** "
- else
- scope=""
- fi
+ printf "%s\n" "$MATCHES" | while IFS=$'\t' read -r msg hash; do
+ if echo "$msg" | grep -Eq '^[a-zA-Z_]+!?\\([^)]+\\):'; then
+ scope=$(echo "$msg" | sed -nE 's/^[a-zA-Z_]+!?\(([^)]+)\).*/\1/p')
+ scope="**$scope:** "
+ else
+ scope=""
+ fi
- clean_msg=$(echo "$msg" | sed -E 's/^[a-zA-Z_]+!?(\([^)]+\))?:[[:space:]]*//')
+ clean_msg=$(echo "$msg" | sed -E 's/^[a-zA-Z_]+!?(\([^)]+\))?:[[:space:]]*//')
- # - scope:msg (hash)
- echo "- $scope$clean_msg (\`$hash\`)" >> $CHANGELOG_FILE
- done
+ # - scope:msg (hash)
+ printf -- "- %s%s (\`%s\`)\n" "$scope" "$clean_msg" "$hash" >> "$CHANGELOG_FILE"
+ done
- echo "" >> $CHANGELOG_FILE
+ echo "" >> $CHANGELOG_FILE
fi
}
# write each section
- write_section "πŸš€ Features" "^feat(\(.+\))?:"
+ write_section "✨ Features" "^feat(\(.+\))?:"
write_section "πŸ› Bug Fixes" "^fix(\(.+\))?:"
- write_section "🌟 Performance" "^perf(\(.+\))?:"
- write_section "πŸ”’ Refactors" "^refactor(\(.+\))?:"
- write_section "πŸ“š Documentation" "^docs(\(.+\))?:"
+ write_section "⚑ Performance" "^perf(\(.+\))?:"
+ write_section "πŸ”’ Security" "^security(\(.+\))?:"
+ write_section "♻️ Refactoring" "^refactor(\(.+\))?:"
+ write_section "πŸ“ Documentation" "^docs(\(.+\))?:"
+ write_section "🎨 Styling" "^style(\(.+\))?:"
+ write_section "πŸ§ͺ Testing" "^test(\(.+\))?:"
write_section "πŸ”§ Maintenance" "^chore(\(.+\))?:"
+ write_section "βš™οΈ CI/CD" "^ci(\(.+\))?:"
+ write_section "◀️ Reverts" "^revert(\(.+\))?:"
# write breaking section separately to handle commits and commit descriptions
BREAKING=$(echo "$COMMITS" | grep -E "^[a-z_]+!|BREAKING CHANGE" || true)
@@ -127,8 +132,8 @@ jobs:
echo "" >> $CHANGELOG_FILE
printf "%s\n" "$BREAKING" | while IFS=$'\t' read -r msg hash; do
- clean_msg=$(echo "$msg" | sed -E 's/^[a-z_]+!?\([^)]+\)?:\s*//')
- echo "- $clean_msg (\`$hash\`)" >> $CHANGELOG_FILE
+ clean_msg=$(echo "$msg" | sed -E 's/^[a-z_]+!?\([^)]+\)?:\s*//')
+ printf -- "- %s%s (\`%s\`)\n" "$scope" "$clean_msg" "$hash" >> "$CHANGELOG_FILE"
done
echo "" >> $CHANGELOG_FILE
@@ -138,9 +143,9 @@ jobs:
# write to github output and changelog file (file unused)
{
- echo "CHANGELOG<<EOF"
+ echo "CHANGELOG<<CHANGELOG_EOF"
cat $CHANGELOG_FILE
- echo "EOF"
+ echo "CHANGELOG_EOF"
} >> $GITHUB_OUTPUT
if [ -f "CHANGELOG.md" ]; then
diff --git a/changelog.sh b/changelog.sh
index 85782fb3..93a9866d 100644
--- a/changelog.sh
+++ b/changelog.sh
@@ -47,55 +47,54 @@ write_section() {
TITLE="$1"
PATTERN="$2"
-
- echo $title
- echo $(printf "%s\n" "$COMMITS" | grep -E "$PATTERN" || true)
- echo ""
- echo $(echo "$COMMITS" | grep -E "$PATTERN" || true)
-
# matches commits to the given pattern
MATCHES=$(printf "%s\n" "$COMMITS" | grep -E "$PATTERN" || true)
# if there are matches, write out with scope under the title
if [ -n "$MATCHES" ]; then
- echo "### $TITLE" >> $CHANGELOG_FILE
- echo "" >> $CHANGELOG_FILE
+ echo "### $TITLE" >> $CHANGELOG_FILE
+ echo "" >> $CHANGELOG_FILE
- printf "%s\n" "$MATCHES" | while IFS=$'\t' read -r msg hash; do
- if echo "$msg" | grep -Eq '^[a-zA-Z_]+!?\\([^)]+\\):'; then
- scope=$(echo "$msg" | sed -nE 's/^[a-zA-Z_]+!?\(([^)]+)\).*/\1/p')
- scope="**$scope:** "
- else
- scope=""
- fi
+ printf "%s\n" "$MATCHES" | while IFS=$'\t' read -r msg hash; do
+ if echo "$msg" | grep -Eq '^[a-zA-Z_]+!?\\([^)]+\\):'; then
+ scope=$(echo "$msg" | sed -nE 's/^[a-zA-Z_]+!?\(([^)]+)\).*/\1/p')
+ scope="**$scope:** "
+ else
+ scope=""
+ fi
- clean_msg=$(echo "$msg" | sed -E 's/^[a-zA-Z_]+!?(\([^)]+\))?:[[:space:]]*//')
+ clean_msg=$(echo "$msg" | sed -E 's/^[a-zA-Z_]+!?(\([^)]+\))?:[[:space:]]*//')
- # - scope
- echo "- $scope$clean_msg (\`$hash\`)" >> $CHANGELOG_FILE
- done
+ # - scope:msg (hash)
+ printf -- "- %s%s (\`%s\`)\n" "$scope" "$clean_msg" "$hash" >> "$CHANGELOG_FILE"
+ done
- echo "" >> $CHANGELOG_FILE
+ echo "" >> $CHANGELOG_FILE
fi
}
-# Sections
-write_section "πŸš€ Features" "^feat(\(.+\))?:"
+# write each section
+write_section "✨ Features" "^feat(\(.+\))?:"
write_section "πŸ› Bug Fixes" "^fix(\(.+\))?:"
-write_section "🌟 Performance" "^perf(\(.+\))?:"
-write_section "πŸ”’ Refactors" "^refactor(\(.+\))?:"
-write_section "πŸ“š Documentation" "^docs(\(.+\))?:"
+write_section "⚑ Performance" "^perf(\(.+\))?:"
+write_section "πŸ”’ Security" "^security(\(.+\))?:"
+write_section "♻️ Refactoring" "^refactor(\(.+\))?:"
+write_section "πŸ“ Documentation" "^docs(\(.+\))?:"
+write_section "🎨 Styling" "^style(\(.+\))?:"
+write_section "πŸ§ͺ Testing" "^test(\(.+\))?:"
write_section "πŸ”§ Maintenance" "^chore(\(.+\))?:"
+write_section "βš™οΈ CI/CD" "^ci(\(.+\))?:"
+write_section "◀️ Reverts" "^revert(\(.+\))?:"
-# Breaking changes
+# write breaking section separately to handle commits and commit descriptions
BREAKING=$(echo "$COMMITS" | grep -E "^[a-z_]+!|BREAKING CHANGE" || true)
if [ -n "$BREAKING" ]; then
echo "### 🚨 Breaking Changes" >> $CHANGELOG_FILE
echo "" >> $CHANGELOG_FILE
printf "%s\n" "$BREAKING" | while IFS=$'\t' read -r msg hash; do
- clean_msg=$(echo "$msg" | sed -E 's/^[a-z_]+!?\([^)]+\)?:\s*//')
- echo "- $clean_msg (\`$hash\`)" >> $CHANGELOG_FILE
+ clean_msg=$(echo "$msg" | sed -E 's/^[a-z_]+!?\([^)]+\)?:\s*//')
+ printf -- "- %s%s (\`%s\`)\n" "$scope" "$clean_msg" "$hash" >> "$CHANGELOG_FILE"
done
echo "" >> $CHANGELOG_FILE