refactor: remove config.env and integrate settings into scripts
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s

- Deleted `config.env` as all values are now directly integrated into the scripts.
- Updated `scripts/generate-changelog.sh` to replace remaining `echo` commands with `log_info` and `log_error`.
- Ensured all scripts are self-contained and consistent in their logging and configuration handling.
This commit is contained in:
2025-07-02 13:16:18 +02:00
parent 0ae86f3c94
commit 8e048a1a89
2 changed files with 25 additions and 12 deletions

25
run.sh
View File

@@ -26,10 +26,23 @@
# can reference them (e.g. {{ get_env(name="PACKAGE_NAME") }}).
set -euo pipefail
source "$(dirname "$0")/lib/utils.sh"
source "$(dirname "$0")/lib/logging.sh"
# Minimal utility functions for bootstrap
log_info() {
echo "[INFO] $1"
}
source "$(dirname "$0")/config.env"
log_error() {
echo "[ERROR] $1" >&2
}
validate_arg() {
local arg_name="$1"
local arg_value="$2"
if [[ -z "$arg_value" ]]; then
log_error "Missing required argument: $arg_name"
exit 1
fi
}
# ───────────────────────────────────────────────
VERSION=""
@@ -37,7 +50,9 @@ TAG=""
PACKAGE_NAME=""
AUTHOR_NAME=""
AUTHOR_EMAIL=""
# CLIFF_CONFIG and OUTPUT_FILE are now sourced from .env
OUTPUT_FILE="debian/changelog"
CLIFF_CONFIG=""
REPO_URL="https://git.0xmax42.io/actions/deb-changelog-action"
# ───────────────────────────────────────────────
show_help() { sed -n '2,25p' "$0"; }
@@ -53,7 +68,7 @@ while [[ $# -gt 0 ]]; do
--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 ;;
*) log_error "Unknown option: $1"; show_help; exit 1 ;;
esac
done

View File

@@ -34,12 +34,12 @@ show_help() { sed -n '2,18p' "$0"; }
# 1 Parse CLI options
while [[ $# -gt 0 ]]; do
case "$1" in
-c|--config) [[ $# -lt 2 ]] && { echo "$1 requires a value"; 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 ;;
-c|--config) [[ $# -lt 2 ]] && { log_error "$1 requires a value"; exit 1; }; CONFIG_FILE="$2"; shift 2 ;;
-t|--tag) [[ $# -lt 2 ]] && { log_error "$1 requires a value"; exit 1; }; TAG="$2"; shift 2 ;;
-o|--out) [[ $# -lt 2 ]] && { log_error "$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 ;;
*) log_error "Unknown option: $1"; show_help; exit 1 ;;
esac
done
@@ -53,9 +53,7 @@ if [[ "$DEBUG" = false ]]; then
fi
# 3 Required tools
need() { command -v "$1" >/dev/null || { echo "$1 is required but not installed"; exit 1; }; }
source "$(dirname "$0")/../lib/utils.sh"
source "$(dirname "$0")/../lib/logging.sh"
need() { command -v "$1" >/dev/null || { log_error "$1 is required but not installed"; exit 1; }; }
need git; need git-cliff; need sed
# 4 Generate changelog