Skip to content

Commit

Permalink
feat: added request-review job
Browse files Browse the repository at this point in the history
  • Loading branch information
jguddas committed Sep 27, 2024
1 parent c6a4908 commit e0d7002
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
name: Add Changed Icons comment

on:
pull_request_target:
paths:
- 'icons/*'
branches:
- main
- fix-icon-preview
on: [pull_request]

jobs:
request-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
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@v41
with:
files: icons/*.svg
- run: |
while IFS= read -r file; do
jq -r '.contributors[]' "${file%.svg}.json"
done <<< "$CHANGED_FILES" | while read -r contributor; do
gh pr edit "${{ github.event.pull_request.number }}" --add-reviewer "$contributor"
done
env:
GH_TOKEN: ${{ github.token }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
lint-filenames:
if: github.repository == 'lucide-icons/lucide'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -69,6 +88,7 @@ jobs:
# output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
lint-aliases:
if: github.repository == 'lucide-icons/lucide'
name: Check Uniqueness of Aliases
runs-on: ubuntu-latest
permissions:
Expand All @@ -79,6 +99,7 @@ jobs:
run: "! cat <(printf \"%s\\n\" icons/*.json | while read -r name; do basename \"$name\" .json; done) <(jq -cr 'select(.aliases) | .aliases[] | if type==\"string\" then . else .name end' icons/*.json) | sort | uniq -c | grep -ve '^\\s*1 '"

generate-changed-icons-comment:
if: github.repository == 'lucide-icons/lucide'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion icons/a-arrow-down.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ericfennis"
],
"tags": [
"letter",
"letters",
"font size",
"text",
"formatting",
Expand Down
2 changes: 1 addition & 1 deletion icons/a-arrow-up.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ericfennis"
],
"tags": [
"letter",
"letters",
"font size",
"text",
"formatting",
Expand Down
2 changes: 1 addition & 1 deletion icons/a-arrow-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e0d7002

Please sign in to comment.