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

Add GitHub Action to check image upload sizes #857

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

Conversation

rahulsunil2
Copy link

@rahulsunil2 rahulsunil2 commented Sep 30, 2024

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

  • 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]
  • 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 rahulsunil2 requested review from a team as code owners September 30, 2024 19:07
Copy link

linux-foundation-easycla bot commented Sep 30, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@rahulsunil2
Copy link
Author

This fixes: #633

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.

1 participant