Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include file path in the error message #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

findepi
Copy link

@findepi findepi commented Jul 17, 2024

This makes the error clear directly on the build log output page. Before
the change, the file name was visible only on the build summary
(annotations).

This makes the error clear directly on the build log output page. Before
the change, the file name was visible only on the build summary
(annotations).
Comment on lines +15 to +16
if [ -z "$path" ]; then
# Skip objects which are not files (commits, trees)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no assumption that the commit is the one currently checked out.

Nor is there any reason to limit it to not-commits.
e.g. someone might be really silly and create a multi-megabyte commit message.

@@ -25,7 +29,7 @@ while read -r obj_id path; do

if [ "$GITHUB_ACTION" != "" ] && [ "$GITHUB_WORKFLOW" != "" ]; then
# Output special github workflow metadata
printf "::error file=%s::Large git object (%d bytes)\n" "$path" "$size"
echo "::error file=$path::File $path is too large ($size bytes, $max_size is the limit)"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why swap from printf to echo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants