diff --git a/run.sh b/run.sh index 8309f47..012a088 100755 --- a/run.sh +++ b/run.sh @@ -24,16 +24,18 @@ exit_code=$? CONTEXT="$(mktemp)" GIT_CLIFF_OUTPUT="$CONTEXT" ./bin/git-cliff $args --context -# Output to console -cat "$OUTPUT" - # Revert permissions chown -R "$owner" . -# Set the changelog content -echo "content<>$GITHUB_OUTPUT -cat "$OUTPUT" >>$GITHUB_OUTPUT -echo "EOF" >>$GITHUB_OUTPUT +# Set the changelog content (max: 50MB) +FILESIZE=$(stat -c%s "$OUTPUT") +MAXSIZE=$((40 * 1024 * 1024)) +if [ "$FILESIZE" -le "$MAXSIZE" ]; then + echo "content<>$GITHUB_OUTPUT + cat "$OUTPUT" >>$GITHUB_OUTPUT + echo "EOF" >>$GITHUB_OUTPUT + cat "$OUTPUT" +fi # Set output file echo "changelog=$OUTPUT" >>$GITHUB_OUTPUT @@ -42,4 +44,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 \ No newline at end of file +echo "exit_code=$exit_code" >>$GITHUB_OUTPUT