10 Commits
v0.2.1 ... main

Author SHA1 Message Date
7e5c4e9102 chore(changelog): update unreleased changelog 2025-12-14 09:05:06 +00:00
f6c99d11e2 chore(scripts): improve CLI option parsing and error handling
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
2025-12-14 10:04:57 +01:00
7e23c3f8ec chore(changelog): update unreleased changelog 2025-12-14 08:59:23 +00:00
90e0d06efd chore: suppress git detached HEAD advice during clone
All checks were successful
Auto Changelog & Release / release (push) Successful in 6s
2025-12-14 09:59:13 +01:00
369f740c1b chore(changelog): update changelog for v0.2.3
All checks were successful
Create Major Version Tag / update-major-tag (release) Successful in 6s
2025-12-13 19:26:51 +00:00
c2999be2cd chore(version): bump version to 0.2.3
All checks were successful
Auto Changelog & Release / release (push) Successful in 9s
2025-12-13 20:26:39 +01:00
1c12062f12 Revert "chore(changelog): normalize version headings by replacing hyphens with tildes"
This reverts commit a2a77a49b1.
2025-12-13 20:26:24 +01:00
a38586f52c fix(changelog): normalize version hyphens to tildes in Debian changelog 2025-12-13 20:26:12 +01:00
1239d67412 chore(version): bump version to 0.2.2
All checks were successful
Auto Changelog & Release / release (push) Successful in 8s
Create Major Version Tag / update-major-tag (release) Successful in 7s
2025-12-13 20:11:36 +01:00
a2a77a49b1 chore(changelog): normalize version headings by replacing hyphens with tildes 2025-12-13 20:11:36 +01:00
5 changed files with 145 additions and 35 deletions

View File

@@ -2,6 +2,19 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [unreleased]
### ⚙️ Miscellaneous Tasks
- *(scripts)* Improve CLI option parsing and error handling - ([f6c99d1](https://git.0xmax42.io/actions/deb-changelog-action/commit/f6c99d11e2cc24591e06bd52562d6387456fc287))
- Suppress git detached HEAD advice during clone - ([90e0d06](https://git.0xmax42.io/actions/deb-changelog-action/commit/90e0d06efdd5a32e86fab6df8a728e18c2b390aa))
## [0.2.3](https://git.0xmax42.io/actions/deb-changelog-action/compare/v0.2.2..v0.2.3) - 2025-12-13
### 🐛 Bug Fixes
- *(changelog)* Normalize version hyphens to tildes in Debian changelog - ([a38586f](https://git.0xmax42.io/actions/deb-changelog-action/commit/a38586f52c48a830a8c8a5eda25a50eed40a782f))
## [0.2.1](https://git.0xmax42.io/actions/deb-changelog-action/compare/v0.2.0..v0.2.1) - 2025-12-13 ## [0.2.1](https://git.0xmax42.io/actions/deb-changelog-action/compare/v0.2.0..v0.2.1) - 2025-12-13
### 🚜 Refactor ### 🚜 Refactor

View File

@@ -1 +1 @@
0.2.1 0.2.3

View File

@@ -60,31 +60,75 @@ show_help() {
# 1 ─ Parse CLI options ───────────────────────── # 1 ─ Parse CLI options ─────────────────────────
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--version) VERSION="$2"; shift 2 ;; --version)
--tag) TAG="$2"; shift 2 ;; VERSION="$2"
--package_name) PACKAGE_NAME="$2"; shift 2 ;; shift 2
--author_name) AUTHOR_NAME="$2"; shift 2 ;; ;;
--author_email) AUTHOR_EMAIL="$2"; shift 2 ;; --tag)
--output_file) OUTPUT_FILE="$2"; shift 2 ;; TAG="$2"
--cliff_config) CLIFF_CONFIG="$2"; shift 2 ;; shift 2
-h|--help) show_help; exit 0 ;; ;;
*) echo "❌ Unknown option: $1"; show_help; exit 1 ;; --package_name)
PACKAGE_NAME="$2"
shift 2
;;
--author_name)
AUTHOR_NAME="$2"
shift 2
;;
--author_email)
AUTHOR_EMAIL="$2"
shift 2
;;
--output_file)
OUTPUT_FILE="$2"
shift 2
;;
--cliff_config)
CLIFF_CONFIG="$2"
shift 2
;;
-h | --help)
show_help
exit 0
;;
*)
echo "❌ Unknown option: $1"
show_help
exit 1
;;
esac esac
done done
# 2 ─ Validate mandatory inputs ──────────────── # 2 ─ Validate mandatory inputs ────────────────
[[ -z "$VERSION" ]] && { echo "❌ --version is required"; exit 1; } [[ -z "$VERSION" ]] && {
[[ -z "$TAG" ]] && { echo "❌ --tag is required"; exit 1; } echo "❌ --version is required"
[[ -z "$PACKAGE_NAME" ]] && { echo "❌ --package_name is required"; exit 1; } exit 1
[[ -z "$AUTHOR_NAME" ]] && { echo "❌ --author_name is required"; exit 1; } }
[[ -z "$AUTHOR_EMAIL" ]] && { echo "❌ --author_email is required"; exit 1; } [[ -z "$TAG" ]] && {
echo "❌ --tag is required"
exit 1
}
[[ -z "$PACKAGE_NAME" ]] && {
echo "❌ --package_name is required"
exit 1
}
[[ -z "$AUTHOR_NAME" ]] && {
echo "❌ --author_name is required"
exit 1
}
[[ -z "$AUTHOR_EMAIL" ]] && {
echo "❌ --author_email is required"
exit 1
}
# 3 ─ Prepare temporary clone ────────────────── # 3 ─ Prepare temporary clone ──────────────────
TMP_DIR=$(mktemp -d) TMP_DIR=$(mktemp -d)
trap 'rm -rf "$TMP_DIR"' EXIT trap 'rm -rf "$TMP_DIR"' EXIT
echo "📥 Cloning ${REPO_URL}@${VERSION}$TMP_DIR" echo "📥 Cloning ${REPO_URL}@${VERSION}$TMP_DIR"
git clone --depth 1 --branch "$VERSION" "$REPO_URL" "$TMP_DIR" >/dev/null git -c advice.detachedHead=false \
clone --depth 1 --branch "$VERSION" "$REPO_URL" "$TMP_DIR" >/dev/null
# 4 ─ Install git-cliff via helper script ────── # 4 ─ Install git-cliff via helper script ──────
bash "$TMP_DIR/scripts/install-git-cliff.sh" bash "$TMP_DIR/scripts/install-git-cliff.sh"
@@ -93,7 +137,10 @@ bash "$TMP_DIR/scripts/install-git-cliff.sh"
if [[ -z "$CLIFF_CONFIG" ]]; then if [[ -z "$CLIFF_CONFIG" ]]; then
CLIFF_CONFIG="$TMP_DIR/configs/cliff.debian.toml" CLIFF_CONFIG="$TMP_DIR/configs/cliff.debian.toml"
fi fi
[[ ! -r "$CLIFF_CONFIG" ]] && { echo "❌ Config not found: $CLIFF_CONFIG"; exit 1; } [[ ! -r "$CLIFF_CONFIG" ]] && {
echo "❌ Config not found: $CLIFF_CONFIG"
exit 1
}
# 6 ─ Generate changelog in CURRENT dir ──────── # 6 ─ Generate changelog in CURRENT dir ────────
echo "📝 Generating changelog (output → $OUTPUT_FILE)" echo "📝 Generating changelog (output → $OUTPUT_FILE)"

View File

@@ -1,6 +1,6 @@
[changelog] [changelog]
body = """\ body = """\
{{ get_env(name="PACKAGE_NAME") }} ({% if version %}{{ version | trim_start_matches(pat="v") }}{% else %}0.0.0-1{% endif %}) unstable; urgency=medium\ {{ get_env(name="PACKAGE_NAME") }} ({% if version %}{{ version | replace(from="-", to="~") | trim_start_matches(pat="v") }}{% else %}0.0.0-1{% endif %}) unstable; urgency=medium\
{% for group, commits in commits | group_by(attribute="group") %} {% for group, commits in commits | group_by(attribute="group") %}
* {{ group | striptags | trim | upper_first }}:\ * {{ group | striptags | trim | upper_first }}:\
{% for commit in commits %} {% for commit in commits %}

View File

@@ -39,27 +39,77 @@ show_help() {
# 1 Parse CLI options # 1 Parse CLI options
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
-c|--config) [[ $# -lt 2 ]] && { echo "$1 requires a value"; exit 1; }; CONFIG_FILE="$2"; shift 2 ;; -c | --config)
-t|--tag) [[ $# -lt 2 ]] && { echo "$1 requires a value"; exit 1; }; TAG="$2"; shift 2 ;; [[ $# -lt 2 ]] && {
-o|--out) [[ $# -lt 2 ]] && { echo "$1 requires a value"; exit 1; }; OUT_FILE="$2"; shift 2 ;; echo "$1 requires a value"
-d|--debug) DEBUG=true; shift ;; exit 1
-h|--help) show_help; exit 0 ;; }
*) echo "❌ Unknown option: $1"; show_help; exit 1 ;; CONFIG_FILE="$2"
shift 2
;;
-t | --tag)
[[ $# -lt 2 ]] && {
echo "$1 requires a value"
exit 1
}
TAG="$2"
shift 2
;;
-o | --out)
[[ $# -lt 2 ]] && {
echo "$1 requires a value"
exit 1
}
OUT_FILE="$2"
shift 2
;;
-d | --debug)
DEBUG=true
shift
;;
-h | --help)
show_help
exit 0
;;
*)
echo "❌ Unknown option: $1"
show_help
exit 1
;;
esac esac
done done
# 2 Basic validation # 2 Basic validation
[[ -z "$CONFIG_FILE" || -z "$TAG" ]] && { echo "❌ --config and --tag are required"; show_help; exit 1; } [[ -z "$CONFIG_FILE" || -z "$TAG" ]] && {
[[ "$DEBUG" = false && -z "$OUT_FILE" ]] && { echo "❌ --out is required unless --debug is set"; show_help; exit 1; } echo "❌ --config and --tag are required"
[[ ! -r "$CONFIG_FILE" ]] && { echo "❌ Config file not found or unreadable: $CONFIG_FILE"; exit 1; } show_help
exit 1
}
[[ "$DEBUG" = false && -z "$OUT_FILE" ]] && {
echo "❌ --out is required unless --debug is set"
show_help
exit 1
}
[[ ! -r "$CONFIG_FILE" ]] && {
echo "❌ Config file not found or unreadable: $CONFIG_FILE"
exit 1
}
if [[ "$DEBUG" = false ]]; then if [[ "$DEBUG" = false ]]; then
OUT_DIR=$(dirname "$OUT_FILE") OUT_DIR=$(dirname "$OUT_FILE")
[[ ! -d "$OUT_DIR" ]] && { echo "❌ Output directory does not exist: $OUT_DIR"; exit 1; } [[ ! -d "$OUT_DIR" ]] && {
echo "❌ Output directory does not exist: $OUT_DIR"
exit 1
}
fi fi
# 3 Required tools # 3 Required tools
need() { command -v "$1" >/dev/null || { echo "$1 is required but not installed"; exit 1; }; } need() { command -v "$1" >/dev/null || {
need git; need git-cliff; need sed echo "$1 is required but not installed"
exit 1
}; }
need git
need git-cliff
need sed
# 4 Generate changelog # 4 Generate changelog
if $DEBUG; then if $DEBUG; then
@@ -67,6 +117,6 @@ if $DEBUG; then
git cliff --config "$CONFIG_FILE" -t "$TAG" -s all git cliff --config "$CONFIG_FILE" -t "$TAG" -s all
else else
echo "📝 Generating changelog → $OUT_FILE" echo "📝 Generating changelog → $OUT_FILE"
git cliff --config "$CONFIG_FILE" -t "$TAG" -s all > "$OUT_FILE" git cliff --config "$CONFIG_FILE" -t "$TAG" -s all >"$OUT_FILE"
echo "✅ Changelog written to $OUT_FILE" echo "✅ Changelog written to $OUT_FILE"
fi fi