chore(changelog): improve changelog script output and formatting

This commit is contained in:
2025-12-14 22:09:43 +01:00
parent 473db9aa2d
commit 134b1543b3

View File

@@ -8,14 +8,16 @@ GIT_BRANCH="${GITHUB_REF##refs/heads/}"
# === Step 1: Generate Changelog (only if file exists or on main) === # === Step 1: Generate Changelog (only if file exists or on main) ===
if [[ -f "$CHANGELOG_FILE" || "$GIT_BRANCH" == "main" ]]; then if [[ -f "$CHANGELOG_FILE" || "$GIT_BRANCH" == "main" ]]; then
echo "📄 Generating $CHANGELOG_FILE using git-cliff..." echo "📄 Generating $CHANGELOG_FILE using git-cliff..."
git-cliff -c "$CLIFF_CONFIG" --context \ git-cliff -c "$CLIFF_CONFIG" --context |
| "${GITHUB_ACTION_PATH}/scripts/augment_context.py" \ "${GITHUB_ACTION_PATH}/scripts/augment_context.py" |
| git-cliff -c "$CLIFF_CONFIG" --from-context - -o "$CHANGELOG_FILE" git-cliff -c "$CLIFF_CONFIG" --from-context - -o "$CHANGELOG_FILE"
else else
echo "ℹ️ $CHANGELOG_FILE does not exist and branch is not 'main'. Skipping generation." echo "ℹ️ $CHANGELOG_FILE does not exist and branch is not 'main'. Skipping generation."
exit 0 exit 0
fi fi
echo "$CHANGELOG_FILE generation completed."
# === Step 2: Commit and push changes if any === # === Step 2: Commit and push changes if any ===
git add "$CHANGELOG_FILE" git add "$CHANGELOG_FILE"