Skip to content

Update Icons

Update Icons #559

Workflow file for this run

name: Update Icons
on:
schedule:
- cron: '0 8 * * *'
workflow_dispatch:
env:
FIGMA_API_TOKEN: ${{ secrets.FIGMA_API_TOKEN }}
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: |
npm ci
- name: Update icons
run: |
npm run update-icons > .update-icons-output
- name: Check for changes
id: check-icons
run: |
echo modified=$(`git status --porcelain | grep -q \.svg$` && echo true || echo false) >> $GITHUB_OUTPUT
- name: Configure GPG
if: steps.check-icons.outputs.modified == 'true'
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Create Pull Request
if: steps.check-icons.outputs.modified == 'true'
uses: peter-evans/create-pull-request@4e1beaa7521e8b457b572c090b25bd3db56bf1c5 # v5.0.3
with:
add-paths: icons/
commit-message: '[Icons]: Update icons from Figma'
author: brave-support-admin <[email protected]>
committer: brave-support-admin <[email protected]>
branch: update-icons
delete-branch: true
title: '[Icons]: Update icons from Figma'
body-path: .update-icons-output
token: ${{ secrets.LEO_UPDATE_ICONS_PAT }}