From 599a2400f3cc0eccf78e90f215479c88fd9f7ae2 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Tue, 7 Nov 2023 22:37:08 +0100 Subject: [PATCH 1/9] [Icon Request] textlintrc with extension Fixes PKief/vscode-material-icon-theme#2012 --- src/icons/fileIcons.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/icons/fileIcons.ts b/src/icons/fileIcons.ts index 749406c0a0..35c185a3f2 100644 --- a/src/icons/fileIcons.ts +++ b/src/icons/fileIcons.ts @@ -2097,7 +2097,13 @@ export const fileIcons: FileIcons = { }, { name: 'textlint', - fileNames: ['.textlintrc'], + fileNames: [ + '.textlintrc', + '.textlintrc.js', + '.textlintrc.json', + '.textlintrc.yml', + '.textlintrc.yaml', + ], }, { name: 'scala', fileExtensions: ['scala', 'sc'] }, { name: 'lilypond', fileExtensions: ['ly'] }, From a0a3fac6057c7c2b88c69ed3c189bc0b1c47d8b8 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Tue, 7 Nov 2023 23:06:00 +0100 Subject: [PATCH 2/9] Add crx file icon --- icons/chrome.svg | 3 +++ src/icons/fileIcons.ts | 1 + 2 files changed, 4 insertions(+) create mode 100644 icons/chrome.svg diff --git a/icons/chrome.svg b/icons/chrome.svg new file mode 100644 index 0000000000..74c45133ee --- /dev/null +++ b/icons/chrome.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/icons/fileIcons.ts b/src/icons/fileIcons.ts index 35c185a3f2..eb801bd02d 100644 --- a/src/icons/fileIcons.ts +++ b/src/icons/fileIcons.ts @@ -2458,6 +2458,7 @@ export const fileIcons: FileIcons = { }, { name: 'spwn', fileExtensions: ['spwn'] }, { name: 'templ', fileExtensions: ['templ'] }, + { name: 'chrome', fileExtensions: ['crx'] }, { name: 'stan', fileExtensions: ['stan'] }, { name: 'abap', From 68a7d2b1430742fdd066a510fc71fa32063709dc Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Thu, 16 Nov 2023 23:08:15 +0100 Subject: [PATCH 3/9] Update workflow --- .github/workflows/icon-review.yml | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/icon-review.yml diff --git a/.github/workflows/icon-review.yml b/.github/workflows/icon-review.yml new file mode 100644 index 0000000000..c8316f4e38 --- /dev/null +++ b/.github/workflows/icon-review.yml @@ -0,0 +1,53 @@ +name: Icon Review + +on: + pull_request_target: + paths: + - 'icons/*.svg' + +jobs: + icon-review: + name: Icon Review + runs-on: ubuntu-latest + env: + TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Review SVG files 🔍 + run: | + svgFiles=$(git diff origin/${{ env.TARGET_BRANCH }} --diff-filter=ACMRTUX --name-only | grep '.svg$') + echo "SVG files changed: ${svgFiles}" + npx svg-icon-review ${svgFiles} + + - name: Install jq ⚙️ + run: sudo apt-get install jq + + - name: Upload PNG ⬆️ + env: + IMAGE_UPLOAD: ${{ secrets.IMAGE_UPLOAD }} + id: upload + run: | + IMAGE_URL=$(curl --location 'https://freeimage.host/json' --form 'source=@"./preview.png"' --form 'type="file"' --form 'action="upload"' --form 'auth_token="${{env.IMAGE_UPLOAD}}"' | jq -r '.image.url') + echo image_url=$IMAGE_URL >> $GITHUB_ENV + shell: bash + + - name: Post review in PR ✍️ + uses: actions/github-script@v7 + with: + script: | + const image_url = "${{ env.image_url }}"; + console.log('URL: '+image_url); + const commentBody = '## Preview \n\nThank you for creating a pull request. This preview shows you how your changes will look on the different themes: \n\n ![Generated Preview](' + image_url + ') \n\n You can find more information how to contribute in the [contribution guidelines](https://github.com/PKief/vscode-material-icon-theme/blob/main/CONTRIBUTING.md).'; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: commentBody + }) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2dc5b806da19b2399097947da8db12806fecf970 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Thu, 16 Nov 2023 23:19:09 +0100 Subject: [PATCH 4/9] Update workflow --- .github/workflows/icon-review.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/icon-review.yml b/.github/workflows/icon-review.yml index c8316f4e38..23fd175861 100644 --- a/.github/workflows/icon-review.yml +++ b/.github/workflows/icon-review.yml @@ -17,10 +17,13 @@ jobs: with: fetch-depth: 0 + - name: Get changed files + id: changed-files + uses: jitterbit/get-changed-files@v1 + - name: Review SVG files 🔍 run: | - svgFiles=$(git diff origin/${{ env.TARGET_BRANCH }} --diff-filter=ACMRTUX --name-only | grep '.svg$') - echo "SVG files changed: ${svgFiles}" + svgFiles=$(echo ${{ steps.changed-files.outputs.modified_files }} | tr ' ' '\n' | grep 'icons/*.svg' | tr '\n' ' ') npx svg-icon-review ${svgFiles} - name: Install jq ⚙️ From 4b72516854ab030d0c952da55df424cda9ebd734 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Thu, 16 Nov 2023 23:21:00 +0100 Subject: [PATCH 5/9] Update workflow --- .github/workflows/icon-review.yml | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/icon-review.yml diff --git a/.github/workflows/icon-review.yml b/.github/workflows/icon-review.yml new file mode 100644 index 0000000000..23fd175861 --- /dev/null +++ b/.github/workflows/icon-review.yml @@ -0,0 +1,56 @@ +name: Icon Review + +on: + pull_request_target: + paths: + - 'icons/*.svg' + +jobs: + icon-review: + name: Icon Review + runs-on: ubuntu-latest + env: + TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + uses: jitterbit/get-changed-files@v1 + + - name: Review SVG files 🔍 + run: | + svgFiles=$(echo ${{ steps.changed-files.outputs.modified_files }} | tr ' ' '\n' | grep 'icons/*.svg' | tr '\n' ' ') + npx svg-icon-review ${svgFiles} + + - name: Install jq ⚙️ + run: sudo apt-get install jq + + - name: Upload PNG ⬆️ + env: + IMAGE_UPLOAD: ${{ secrets.IMAGE_UPLOAD }} + id: upload + run: | + IMAGE_URL=$(curl --location 'https://freeimage.host/json' --form 'source=@"./preview.png"' --form 'type="file"' --form 'action="upload"' --form 'auth_token="${{env.IMAGE_UPLOAD}}"' | jq -r '.image.url') + echo image_url=$IMAGE_URL >> $GITHUB_ENV + shell: bash + + - name: Post review in PR ✍️ + uses: actions/github-script@v7 + with: + script: | + const image_url = "${{ env.image_url }}"; + console.log('URL: '+image_url); + const commentBody = '## Preview \n\nThank you for creating a pull request. This preview shows you how your changes will look on the different themes: \n\n ![Generated Preview](' + image_url + ') \n\n You can find more information how to contribute in the [contribution guidelines](https://github.com/PKief/vscode-material-icon-theme/blob/main/CONTRIBUTING.md).'; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: commentBody + }) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b60b9dbb3b4801f23dbdd7381d91f4e47c6ef5d1 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Thu, 16 Nov 2023 23:30:09 +0100 Subject: [PATCH 6/9] Update workflow --- .github/workflows/icon-review.yml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/icon-review.yml diff --git a/.github/workflows/icon-review.yml b/.github/workflows/icon-review.yml new file mode 100644 index 0000000000..91f3385398 --- /dev/null +++ b/.github/workflows/icon-review.yml @@ -0,0 +1,54 @@ +name: Icon Review + +on: + pull_request_target: + paths: + - 'icons/*.svg' + +jobs: + icon-review: + name: Icon Review + runs-on: ubuntu-latest + env: + TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Review SVG files 🔍 + run: | + echo "Target branch: ${{ github.event.pull_request }}" + svgFiles=$(git diff origin/${{ env.TARGET_BRANCH }} --diff-filter=ACMRTUX --name-only | grep '.svg$') + echo "SVG files changed: ${svgFiles}" + npx svg-icon-review ${svgFiles} + + - name: Install jq ⚙️ + run: sudo apt-get install jq + + - name: Upload PNG ⬆️ + env: + IMAGE_UPLOAD: ${{ secrets.IMAGE_UPLOAD }} + id: upload + run: | + IMAGE_URL=$(curl --location 'https://freeimage.host/json' --form 'source=@"./preview.png"' --form 'type="file"' --form 'action="upload"' --form 'auth_token="${{env.IMAGE_UPLOAD}}"' | jq -r '.image.url') + echo image_url=$IMAGE_URL >> $GITHUB_ENV + shell: bash + + - name: Post review in PR ✍️ + uses: actions/github-script@v7 + with: + script: | + const image_url = "${{ env.image_url }}"; + console.log('URL: '+image_url); + const commentBody = '## Preview \n\nThank you for creating a pull request. This preview shows you how your changes will look on the different themes: \n\n ![Generated Preview](' + image_url + ') \n\n You can find more information how to contribute in the [contribution guidelines](https://github.com/PKief/vscode-material-icon-theme/blob/main/CONTRIBUTING.md).'; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: commentBody + }) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0480e6fedbbf37688d043a40d727af85992893a8 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Thu, 16 Nov 2023 23:36:29 +0100 Subject: [PATCH 7/9] Update workflow --- .github/workflows/icon-review.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/icon-review.yml b/.github/workflows/icon-review.yml index 91f3385398..e544ee522d 100644 --- a/.github/workflows/icon-review.yml +++ b/.github/workflows/icon-review.yml @@ -17,9 +17,13 @@ jobs: with: fetch-depth: 0 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Review SVG files 🔍 run: | - echo "Target branch: ${{ github.event.pull_request }}" svgFiles=$(git diff origin/${{ env.TARGET_BRANCH }} --diff-filter=ACMRTUX --name-only | grep '.svg$') echo "SVG files changed: ${svgFiles}" npx svg-icon-review ${svgFiles} From 8086d5d6cfd4d5946bb5dc426c399db3a89733b6 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Thu, 16 Nov 2023 23:39:08 +0100 Subject: [PATCH 8/9] Update workflow --- .github/workflows/icon-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/icon-review.yml b/.github/workflows/icon-review.yml index e544ee522d..b388601e5f 100644 --- a/.github/workflows/icon-review.yml +++ b/.github/workflows/icon-review.yml @@ -10,7 +10,7 @@ jobs: name: Icon Review runs-on: ubuntu-latest env: - TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} + TARGET_BRANCH: ${{ github.event.pull_request.head.ref }} steps: - name: Checkout 🛎️ uses: actions/checkout@v4 From e0a5dbbc5e1c4b7e4ec7ea495e4524f2cd0b49c2 Mon Sep 17 00:00:00 2001 From: Philipp Kief Date: Thu, 16 Nov 2023 23:47:06 +0100 Subject: [PATCH 9/9] Update workflow --- .github/workflows/icon-review.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/icon-review.yml b/.github/workflows/icon-review.yml index b388601e5f..0d30cb97ea 100644 --- a/.github/workflows/icon-review.yml +++ b/.github/workflows/icon-review.yml @@ -10,11 +10,13 @@ jobs: name: Icon Review runs-on: ubuntu-latest env: - TARGET_BRANCH: ${{ github.event.pull_request.head.ref }} + TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} steps: - name: Checkout 🛎️ uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 - name: Dump GitHub context