Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/blade-icon-to-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ name: "Blade icon to code"
on:
workflow_dispatch:
inputs:

fileId:
description: 'Figma File ID'
required: false
type: string
nodeId:
description: 'Figma Node ID'
required: true
type: string

jobs:
create-pr:
Expand Down Expand Up @@ -37,6 +44,8 @@ jobs:
- name: Update icons.json
env:
FIGMA_API_TOKEN: ${{ secrets.FIGMA_API_TOKEN }}
FIGMA_FILE_ID: ${{ inputs.fileId }}
FIGMA_NODE_ID: ${{ inputs.nodeId }}
run: |
cd packages/blade
yarn run fetch-icons
Expand Down Expand Up @@ -66,12 +75,12 @@ jobs:
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "feat: add random file ${{ github.event.inputs.filename }}"
branch: random-file-${{ github.run_id }}
commit-message: "feat: update icons from Figma file ${{ inputs.fileId }}"
branch: update-icons-${{ github.run_id }}
base: master
title: "feat: add new icons"
title: "feat: update icons from Figma"
body: |
This PR was automatically generated by the **Create Random File PR** workflow.
It adds `${{ github.event.inputs.filename }}` containing random or provided text.
This PR was automatically generated by the **Blade icon to code** workflow.
It updates icons from Figma file `${{ inputs.fileId }}` node `${{ inputs.nodeId }}`.
delete-branch: true
# cleans up after merge
4 changes: 2 additions & 2 deletions packages/blade/scripts/getSvgFromFigma.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('path');
const fs = require('fs');

const FILE_ID = 'jubmQL9Z8V7881ayUD95ps';
const NODE_ID = '110782-28621';
const FILE_ID = process.env.FIGMA_FILE_ID || 'jubmQL9Z8V7881ayUD95ps';
const NODE_ID = process.env.FIGMA_NODE_ID || '110782-28621';

async function updateIconsJson(componentNames, svgData) {
const iconsFilePath = path.join(__dirname, 'icons.json');
Expand Down
Loading