Skip to content

Commit

Permalink
fix(action): revert to directory permissions workaround
Browse files Browse the repository at this point in the history
This reverts commit adce476.
  • Loading branch information
orhun committed Feb 6, 2023
1 parent dc8bb43 commit 05204db
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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<<EOF" >> $GITHUB_OUTPUT
cat "$OUTPUT" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 05204db

Please sign in to comment.