From 8c5ab7e83dee8512a68804f13973fd8a26c35f0b Mon Sep 17 00:00:00 2001 From: thervy Date: Mon, 14 Oct 2024 09:04:12 +0200 Subject: [PATCH] [filigran-web][Icons] Automate icon creation --- .github/workflows/icons.yml | 12 ++++++++---- packages/filigran-icon/script/fetchFromFigma.mjs | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/icons.yml b/.github/workflows/icons.yml index 9b1533b..662db9c 100644 --- a/.github/workflows/icons.yml +++ b/.github/workflows/icons.yml @@ -51,15 +51,19 @@ jobs: run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git checkout -b update-icons-branch + git checkout -B update-icons-branch + git status git add . + git status git commit -m "Update icons and build artifacts" - git push origin update-icons-branch + git push --set-upstream origin update-icons-branch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v7 with: - token: ${{ secrets.TOKEN_GITHUB }} + token: ${{ secrets.GITHUB_TOKEN }} branch: update-icons-branch title: "Update icons and build artifacts" body: "This PR was automatically created by GitHub Actions after building the icons." diff --git a/packages/filigran-icon/script/fetchFromFigma.mjs b/packages/filigran-icon/script/fetchFromFigma.mjs index 9e6c324..80aa857 100644 --- a/packages/filigran-icon/script/fetchFromFigma.mjs +++ b/packages/filigran-icon/script/fetchFromFigma.mjs @@ -55,6 +55,7 @@ async function run () { console.error('The Figma file ID is not defined, you need to set an environment variable `FIGMA_FILE_ID` to run the script'); return; } + fetchFigmaFile() .then(data => getComponentsFromNode(data)) .then(components => getIllustrationName(components))