From 3948e88ea7032b7f574cd5a688b3d36800388337 Mon Sep 17 00:00:00 2001 From: Gabriel Torcat <87126387+gabr1elt@users.noreply.github.com> Date: Sun, 10 Aug 2025 09:26:26 +0200 Subject: [PATCH] feat(run): toggle trace logs with environment variable (#59) Now you can enable trace logs via setting the `DEBUG` variable to a value. It is also now disabled as default. closes #60 --- README.md | 1 + run.sh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d1b3d2e..c8cfa7a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ This action generates a changelog based on your Git history using [git-cliff](ht ### Environment variables - `OUTPUT`: Output file. (Default: `"git-cliff/CHANGELOG.md"`) +- `DEBUG`: Set to a not empty value (e.g. `"true"`) to print executed commmands. (Default: `unset`) > [!IMPORTANT] > Check out the entire history via `fetch-depth: 0` before running this action. diff --git a/run.sh b/run.sh index 7f1b517..fd053f6 100755 --- a/run.sh +++ b/run.sh @@ -1,6 +1,10 @@ #!/bin/bash -set -uxo pipefail +if [[ -n "$DEBUG" ]]; then + set -x +fi + +set -uo pipefail # Avoid file expansion when passing parameters like with '*' set -o noglob