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 100% scale variant to GitHub comments icon workflow #1113

Conversation

danielbayley
Copy link
Member

Building on @jguddas excellent work in #946, could we also include a 100% scale (24x24px) preview?

@danielbayley danielbayley marked this pull request as draft April 18, 2023 15:21
@jguddas
Copy link
Member

jguddas commented Apr 18, 2023

         uses: tj-actions/changed-files@v35
         with:
           files: icons/*.svg
+      - name: Generate preview
+        id: generate-preview
+        run: |
+          delimiter="$(openssl rand -hex 8)"
+          echo "body<<$delimiter" >> $GITHUB_OUTPUT
+          for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
+            echo "![$file](https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.pull_request.head.ref }}/icons/$file) "
+          done | tr '\n' ' ' >> $GITHUB_OUTPUT
+          echo >> $GITHUB_OUTPUT
+          echo "$delimiter" >> $GITHUB_OUTPUT
       - name: Generate comment
         id: generate-comment
         run: |
@@ -50,6 +60,7 @@ jobs:
           issue-number: ${{ github.event.pull_request.number }}
           body: |
             ### Added or changed icons
+            ${{ steps.generate-preview.outputs.body }}
             <details>
             <summary>Icon X-rays</summary>
             ${{ steps.generate-comment.outputs.body }}

Result (not tested)

Added or changed icons

accessibility

Icon X-rays

@jguddas
Copy link
Member

jguddas commented Apr 18, 2023

We could also add a preview with 3px and 1px stroke width.

@danielbayley danielbayley force-pushed the github-comment-icon-workflow branch from e596c7b to e161f05 Compare April 19, 2023 11:06
@danielbayley
Copy link
Member Author

I wonder if we could run similar code on issue_comments, so that we can simply paste SVG markup, and have it render in the same way…?

Something like:

on:
  issue_comment:
    types: [created]

@danielbayley danielbayley force-pushed the github-comment-icon-workflow branch from ef51f19 to 4aea3b8 Compare April 27, 2023 13:42
@jguddas
Copy link
Member

jguddas commented Apr 30, 2023

#1180

@ericfennis
Copy link
Member

Fixed by #1180

@ericfennis ericfennis closed this May 6, 2023
@danielbayley danielbayley deleted the github-comment-icon-workflow branch May 6, 2023 14:19
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.

3 participants