Files
Max P. 064677870b
All checks were successful
Auto Changelog & Release / release (push) Successful in 6s
fix(ci): use ACTION_PATH for git-cliff config generation
2025-11-24 12:35:06 +01:00

15 lines
545 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
CLIFF_CONFIG="cliff.toml"
# Check if cliff.toml exists, if not, copy cliff.toml.template from the Action
if [ ! -f "$CLIFF_CONFIG" ]; then
echo "cliff.toml not found, using template from action."
cp "$ACTION_PATH/cliff.toml.template" "$CLIFF_CONFIG"
# Replace placeholders in the copied config
OWNER="${GITHUB_REPOSITORY%/*}"
REPO="${GITHUB_REPOSITORY#*/}"
sed -i "s/owner = \"%OWNER%\"/owner = \"$OWNER\"/g" "$CLIFF_CONFIG"
sed -i "s/repo = \"%REPO%\"/repo = \"$REPO\"/g" "$CLIFF_CONFIG"
fi