refactor: remove config.env and integrate settings into scripts
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
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:
25
run.sh
25
run.sh
@@ -26,10 +26,23 @@
|
|||||||
# can reference them (e.g. {{ get_env(name="PACKAGE_NAME") }}).
|
# can reference them (e.g. {{ get_env(name="PACKAGE_NAME") }}).
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
source "$(dirname "$0")/lib/utils.sh"
|
# Minimal utility functions for bootstrap
|
||||||
source "$(dirname "$0")/lib/logging.sh"
|
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=""
|
VERSION=""
|
||||||
@@ -37,7 +50,9 @@ TAG=""
|
|||||||
PACKAGE_NAME=""
|
PACKAGE_NAME=""
|
||||||
AUTHOR_NAME=""
|
AUTHOR_NAME=""
|
||||||
AUTHOR_EMAIL=""
|
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"; }
|
show_help() { sed -n '2,25p' "$0"; }
|
||||||
@@ -53,7 +68,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
--output_file) OUTPUT_FILE="$2"; shift 2 ;;
|
--output_file) OUTPUT_FILE="$2"; shift 2 ;;
|
||||||
--cliff_config) CLIFF_CONFIG="$2"; shift 2 ;;
|
--cliff_config) CLIFF_CONFIG="$2"; shift 2 ;;
|
||||||
-h|--help) show_help; exit 0 ;;
|
-h|--help) show_help; exit 0 ;;
|
||||||
*) echo "❌ Unknown option: $1"; show_help; exit 1 ;;
|
*) log_error "Unknown option: $1"; show_help; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@@ -34,12 +34,12 @@ show_help() { sed -n '2,18p' "$0"; }
|
|||||||
# 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) [[ $# -lt 2 ]] && { log_error "$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 ;;
|
-t|--tag) [[ $# -lt 2 ]] && { log_error "$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 ;;
|
-o|--out) [[ $# -lt 2 ]] && { log_error "$1 requires a value"; exit 1; }; OUT_FILE="$2"; shift 2 ;;
|
||||||
-d|--debug) DEBUG=true; shift ;;
|
-d|--debug) DEBUG=true; shift ;;
|
||||||
-h|--help) show_help; exit 0 ;;
|
-h|--help) show_help; exit 0 ;;
|
||||||
*) echo "❌ Unknown option: $1"; show_help; exit 1 ;;
|
*) log_error "Unknown option: $1"; show_help; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -53,9 +53,7 @@ if [[ "$DEBUG" = false ]]; then
|
|||||||
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 || { log_error "$1 is required but not installed"; exit 1; }; }
|
||||||
source "$(dirname "$0")/../lib/utils.sh"
|
|
||||||
source "$(dirname "$0")/../lib/logging.sh"
|
|
||||||
need git; need git-cliff; need sed
|
need git; need git-cliff; need sed
|
||||||
|
|
||||||
# 4 Generate changelog
|
# 4 Generate changelog
|
||||||
|
Reference in New Issue
Block a user