name: Pull request icon preview on: pull_request_target: types: - opened - reopened - synchronize - edited paths: - 'icons/*.svg' permissions: {} concurrency: group: icon-preview-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: icon-preview: name: Icon Preview if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest permissions: contents: read pull-requests: write # Required to edit the PR description steps: # We check out the main branch of the main repository for security reasons. # The action only gets the changed file names and the head SHA as inputs, so no # code from the (untrusted) pull request is checked out or run. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: lucide-icons/lucide persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: 'package.json' - name: Get changed files id: changed-files uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: icons/*.svg # The checkout is the base branch, so the PR head commit isn't available locally. use_rest_api: true - name: Update PR description uses: ./.github/actions/icon-preview with: pr-number: ${{ github.event.pull_request.number }} head-sha: ${{ github.event.pull_request.head.sha }} added-files: ${{ steps.changed-files.outputs.added_files }} # Added, copied, modified and renamed files; deleted icons are left out. changed-files: ${{ steps.changed-files.outputs.all_changed_files }} github-token: ${{ secrets.GITHUB_TOKEN }}