Update Icons #616
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- 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@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.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 }} |