feat: changed mouse-pointer-click
#2163
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Add Changed Icons comment | |
on: | |
pull_request_target: | |
paths: | |
- 'icons/*.svg' | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
add-changed-icons-comment: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: refs/pull/${{ github.event.pull_request.number }}/merge | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v35 | |
with: | |
files: icons/*.svg | |
- name: Generate 24px dpi preview | |
id: generate-24px-dpi-preview | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<$delimiter" >> $GITHUB_OUTPUT | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
cat "$file" | # get file content | |
tr '\n' ' ' | # remove line breaks | |
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element | |
base64 -w 0 | # encode svg | |
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/dpi/24/&.svg\"/> |" | |
done | tr '\n' ' ' >> $GITHUB_OUTPUT | |
echo >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Generate cohesion check random | |
id: generate-cohesion-check-random | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<$delimiter" >> $GITHUB_OUTPUT | |
for file in $(printf "%s\\n" icons/*.svg | shuf | head -n$(awk -F' ' '{print NF}' <<< '${{ steps.changed-files.outputs.all_changed_files }}')); do | |
cat "$file" | # get file content | |
tr '\n' ' ' | # remove line breaks | |
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element | |
base64 -w 0 | # encode svg | |
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |" | |
done | tr '\n' ' ' >> $GITHUB_OUTPUT | |
echo >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Generate cohesion check squares | |
id: generate-cohesion-check-squares | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<$delimiter" >> $GITHUB_OUTPUT | |
for file in $(printf "%s\\n" icons/*square*.svg | shuf | head -n$(awk -F' ' '{print NF}' <<< '${{ steps.changed-files.outputs.all_changed_files }}')); do | |
cat "$file" | # get file content | |
tr '\n' ' ' | # remove line breaks | |
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element | |
base64 -w 0 | # encode svg | |
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |" | |
done | tr '\n' ' ' >> $GITHUB_OUTPUT | |
echo >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Generate 1px stroke-width | |
id: generate-1px-stroke-width | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<$delimiter" >> $GITHUB_OUTPUT | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
cat "$file" | # get file content | |
tr '\n' ' ' | # remove line breaks | |
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element | |
base64 -w 0 | # encode svg | |
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/1/&.svg\"/> |" | |
done | tr '\n' ' ' >> $GITHUB_OUTPUT | |
echo >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Generate 2px stroke-width | |
id: generate-2px-stroke-width | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<$delimiter" >> $GITHUB_OUTPUT | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
cat "$file" | # get file content | |
tr '\n' ' ' | # remove line breaks | |
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element | |
base64 -w 0 | # encode svg | |
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |" | |
done | tr '\n' ' ' >> $GITHUB_OUTPUT | |
echo >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Generate 3px stroke-width | |
id: generate-3px-stroke-width | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<$delimiter" >> $GITHUB_OUTPUT | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
cat "$file" | # get file content | |
tr '\n' ' ' | # remove line breaks | |
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element | |
base64 -w 0 | # encode svg | |
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/3/&.svg\"/> |" | |
done | tr '\n' ' ' >> $GITHUB_OUTPUT | |
echo >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Generate X-rays | |
id: generate-x-rays | |
run: | | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<$delimiter" >> $GITHUB_OUTPUT | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
cat "$file" | # get file content | |
tr '\n' ' ' | # remove line breaks | |
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element | |
base64 -w 0 | # encode svg | |
sed "s|.*|<img width=\"400\" title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/$(basename ${file//\.svg/})/&.svg\"/> |" | |
done | tr '\n' ' ' >> $GITHUB_OUTPUT | |
echo >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Find Comment | |
uses: peter-evans/find-comment@v2 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: Added or changed icons | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
### Added or changed icons | |
${{ steps.generate-2px-stroke-width.outputs.body }}<br/> | |
<details> | |
<summary>Preview cohesion</summary> | |
${{ steps.generate-cohesion-check-squares.outputs.body }}<br/> | |
${{ steps.generate-2px-stroke-width.outputs.body }}<br/> | |
${{ steps.generate-cohesion-check-random.outputs.body }}<br/> | |
</details> | |
<details> | |
<summary>Preview stroke widths</summary> | |
${{ steps.generate-1px-stroke-width.outputs.body }}<br/> | |
${{ steps.generate-2px-stroke-width.outputs.body }}<br/> | |
${{ steps.generate-3px-stroke-width.outputs.body }}<br/> | |
</details> | |
<details> | |
<summary>DPI Preview (24px)</summary> | |
${{ steps.generate-24px-dpi-preview.outputs.body }}<br/> | |
</details> | |
<details> | |
<summary>Icon X-rays</summary> | |
${{ steps.generate-x-rays.outputs.body }} | |
</details> | |
edit-mode: replace |