Skip to content

Commit

Permalink
fix(action): limit content size to 50MB
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Sep 26, 2024
1 parent a4f49b8 commit 716a66a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ cat "$OUTPUT"
# Revert permissions
chown -R "$owner" .

# Set the changelog content
echo "content<<EOF" >>$GITHUB_OUTPUT
cat "$OUTPUT" >>$GITHUB_OUTPUT
echo "EOF" >>$GITHUB_OUTPUT
# Set the changelog content (max: 50MB)
FILESIZE=$(stat -c%s "$OUTPUT")
MAXSIZE=$((50 * 1024 * 1024))
if [ "$FILESIZE" -le "$MAXSIZE" ]; then
echo "content<<EOF" >>$GITHUB_OUTPUT
cat "$OUTPUT" >>$GITHUB_OUTPUT
echo "EOF" >>$GITHUB_OUTPUT
fi

# Set output file
echo "changelog=$OUTPUT" >>$GITHUB_OUTPUT
Expand All @@ -42,4 +46,4 @@ echo "changelog=$OUTPUT" >>$GITHUB_OUTPUT
echo "version=$(jq -r '.[0].version' $CONTEXT)" >>$GITHUB_OUTPUT

# Pass exit code to the next step
echo "exit_code=$exit_code" >>$GITHUB_OUTPUT
echo "exit_code=$exit_code" >>$GITHUB_OUTPUT

0 comments on commit 716a66a

Please sign in to comment.