From 05204db500127e1d06a0ec1cbd7b720226bb4b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Mon, 6 Feb 2023 13:59:01 +0300 Subject: [PATCH] fix(action): revert to directory permissions workaround This reverts commit adce4765f308e3a0feec8e7db824d2edc75cd129. --- entrypoint.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index e8c0fed..458f259 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,10 +4,9 @@ set -uxo pipefail # Avoid file expansion when passing parameters like with '*' set -o noglob -# Set up permissions -if [[ $(id -u) -ne $(stat -c '%u' .) ]]; then - eids=$(stat -c '--euid %u --egid %g' .) -fi +# Set up working directory +owner=$(stat -c "%u:%g" .) +chown -R "$(id -u)" . # Create the output directory OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"} @@ -17,12 +16,15 @@ mkdir -p "$(dirname $OUTPUT)" args=$(echo "$@" | xargs) # Execute git-cliff -GIT_CLIFF_OUTPUT="$OUTPUT" ${eids:+setpriv --clear-groups $eids} git-cliff $args +GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args exit_code=$? # Output to console cat "$OUTPUT" +# Revert permissions +chown -R "$owner" . + # Set the changelog content echo "content<> $GITHUB_OUTPUT cat "$OUTPUT" >> $GITHUB_OUTPUT