From 6ecc253414209ed11405c79e95a5210d8a6de972 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 | 16 +++++++--------- packages/filigran-icon/script/fetchFromFigma.mjs | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/icons.yml b/.github/workflows/icons.yml index 9b1533b..9a32935 100644 --- a/.github/workflows/icons.yml +++ b/.github/workflows/icons.yml @@ -51,16 +51,14 @@ 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 add . 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 - with: - token: ${{ secrets.TOKEN_GITHUB }} - branch: update-icons-branch - title: "Update icons and build artifacts" - body: "This PR was automatically created by GitHub Actions after building the icons." - base: main + run: gh pr create --title "Update icons and build artifacts" --body "This PR updates the icons and build artifacts." --base main --head update-icons-branch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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))