openfga.dev icon indicating copy to clipboard operation
openfga.dev copied to clipboard

Add GitHub Action to check image upload sizes

Open rahulsunil2 opened this issue 4 months ago • 2 comments

Add GitHub Action to check image upload sizes

Description

This PR introduces a new GitHub Action workflow that automatically checks the size of image files (jpg, jpeg, png, gif) uploaded in pull requests. The workflow enforces a maximum file size limit of 5MB for all new or modified images. If any image exceeds this limit, the workflow will fail and provide a list of oversized images, helping to maintain repository size and ensure efficient loading of images in the project.

Key features of this workflow:

  • Triggers on pull requests that modify image files
  • Checks only new or modified images
  • Enforces a 5MB size limit (configurable via environment variable)
  • Provides clear error messages with file names and sizes for any oversized images
  • Allows the workflow to pass if all images are within the size limit

References

Review Checklist

  • [x] I have clicked on "allow edits by maintainers".
  • [ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • [x] The correct base branch is being used, if not main
  • [ ] I have added tests to validate that the change in functionality is working as expected

rahulsunil2 avatar Sep 30 '24 19:09 rahulsunil2