fix(action): revert to directory permissions workaround

This reverts commit adce4765f3.
This commit is contained in:
Orhun Parmaksız
2023-02-06 13:59:01 +03:00
parent dc8bb43a76
commit 05204db500

View File

@@ -4,10 +4,9 @@ set -uxo pipefail
# Avoid file expansion when passing parameters like with '*' # Avoid file expansion when passing parameters like with '*'
set -o noglob set -o noglob
# Set up permissions # Set up working directory
if [[ $(id -u) -ne $(stat -c '%u' .) ]]; then owner=$(stat -c "%u:%g" .)
eids=$(stat -c '--euid %u --egid %g' .) chown -R "$(id -u)" .
fi
# Create the output directory # Create the output directory
OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"} OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"}
@@ -17,12 +16,15 @@ mkdir -p "$(dirname $OUTPUT)"
args=$(echo "$@" | xargs) args=$(echo "$@" | xargs)
# Execute git-cliff # Execute git-cliff
GIT_CLIFF_OUTPUT="$OUTPUT" ${eids:+setpriv --clear-groups $eids} git-cliff $args GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args
exit_code=$? exit_code=$?
# Output to console # Output to console
cat "$OUTPUT" cat "$OUTPUT"
# Revert permissions
chown -R "$owner" .
# Set the changelog content # Set the changelog content
echo "content<<EOF" >> $GITHUB_OUTPUT echo "content<<EOF" >> $GITHUB_OUTPUT
cat "$OUTPUT" >> $GITHUB_OUTPUT cat "$OUTPUT" >> $GITHUB_OUTPUT