-
Notifications
You must be signed in to change notification settings - Fork 438
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 a GH workflow to check for non-svg icons in the showcase. #3802
Conversation
- name: Check for non-SVG files | ||
run: | | ||
# Find new or modified files in the "images" directory | ||
files=$(git diff --name-only ${{ github.event.before }} HEAD -- statuc/img/showcase/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The showcase allows projects to add screenshots and videos in this directory. If you want to check for logos only, you should filter for filenames ending with _logo
IMHO.
for file in $files; do | ||
if [[ "$file" != *.svg ]]; then | ||
echo "❌ Non-SVG file detected: $file" | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra check at build time to validate the showcase file, although I suspect the rules there are too relaxed to be useful for you: https://github.com/dfinity/portal/blob/master/plugins/validate-showcase.js#L200
The purpose is to fail PR build checks if the submission isn't following the guidelines, and then hopefully it doesn't get merged. This can be made more strict, but then the current logos in the repo need to be resized/converted to pass validation @reigj1
Nevertheless maybe this can be tweaked to be more helpful.
# Loop through the files and check extensions | ||
for file in $files; do | ||
if [[ "$file" != *.svg ]]; then | ||
echo "❌ Non-SVG file detected: $file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the relevant part of the README.md file if logos must be SVG's from now on.
Closing this PR. We decided to take another approach instead of allowing only SVGs. |
Motivation
Keeping the icons for the showcase small.
Changes
Add a github workflow that checks that the icons in the showcase directory are SVGs.
Tests
I'll test this after it's deployed with a new PR adding an icon that is not SVG, they I'll change it to a PR.
If the workflow works as expected, I will add it as a necessary check before merging the PR.
Contribution Info
Thank you for your contribution to the IC Developer Portal. This repo contains the content for https://internetcomputer.org and the ICP Developer Documentation, https://internetcomputer.org/docs/.
If you are submitting a Pull Request for adding or changing content on the ICP Developer Documentation, please make sure that your contribution meets the following requirements:
.mdx
file format to support the previous two components./sidebars.js
, otherwise, it will not appear in theside navigation bar.
.github/CODEOWNERS
file isfilled with new documents that you added. This way we can ensure that future Pull Requests are reviewed by the right people.