-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (44 loc) · 1.87 KB
/
import-figma-icons.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Import Figma icons
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *" # run daily at 6 am
jobs:
import:
name: Import Figma icons
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/templates/node-setup
- name: 🛠️ Build Figma utils
run: pnpm run build
working-directory: packages/figma-utils
# delete all icons before importing them so no longer existing or renamed icons are removed
- name: Clear icons
run: rm -rfv src/assets/*
working-directory: packages/icons
- name: Import icons
run: |
pnpm run @sit-onyx/figma-utils import-icons -k "${{ vars.FIGMA_FILE_KEY_ICONS }}" -t "${{ secrets.FIGMA_TOKEN }}" -p "${{ vars.FIGMA_ICON_PAGE_ID }}" -d "../icons/src/assets" -m "../icons/src/metadata.json"
working-directory: packages/figma-utils
- name: Generate changeset
run: |
git add .
pnpm run generate:changeset
working-directory: packages/icons
# needed to prevent creating empty PR when nothing but the formatting changed
- name: Format with prettier
run: pnpm prettier --write src/metadata.json
working-directory: packages/icons
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
commit-message: "feat: update Figma icons"
title: "feat: update Figma icons"
body: |
This is an auto-generated pull request.
All icons have been imported from the [Figma file](https://www.figma.com/design/${{ vars.FIGMA_FILE_KEY_ICONS }}?node-id=${{ vars.FIGMA_ICON_PAGE_ID }}).
branch-suffix: short-commit-hash # needed to not override other pull requests created via workflows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.ref_name }}