test #1
Workflow file for this run
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: Screenshot test | |
# push: | |
# paths: | |
# - ".github/workflows/figma-export.yml" | |
on: | |
push: | |
branches: | |
- visual-regression | |
# workflow_dispatch: | |
# inputs: | |
# brand: | |
# type: choice | |
# description: Library to export | |
# required: true | |
# default: "all" | |
# options: | |
# - all | |
# - telefonica | |
# - o2 | |
# - blau | |
# - vivo | |
# draft: | |
# type: boolean | |
# default: true | |
# description: Draft PR | |
env: | |
FIGMA_ACCESS_TOKEN: ${{ secrets.FIGMA_ACCESS_TOKEN }} | |
jobs: | |
export-all: | |
if: ${{ github.event.inputs.brand == 'all' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# - name: Get branch name | |
# uses: rlespinasse/[email protected] | |
- name: Install packages | |
run: | | |
pip install figma_export | |
- name: Checkout branch or create new one | |
run: | | |
git fetch | |
if git branch -a | grep origin/import-figma-icons; then | |
git checkout import-figma-icons | |
else | |
git checkout -b import-figma-icons | |
fi | |
- name: screenshoting! | |
run: figma_export png DOCUMENT_ID | |
- name: Commit & Push | |
run: | | |
git config user.name "github-actions" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Figma icons updated" | |
git push origin import-figma-icons | |
# - name: Create Pull-Request | |
# uses: repo-sync/pull-request@v2 | |
# with: | |
# source_branch: import-figma-icons | |
# destination_branch: "production" | |
# pr_title: "Update Figma icons" | |
# pr_body: " | |
# New version of icons exported from [Mistica Icons](${{env.MISTICA_ICONS_FILE_URL}}), [O2](${{env.O2_FILE_URL}}), [Blau](${{env.BLAU_FILE_URL}}) & [Vivo](${{env.VIVO_FILE_URL}}) \n | |
# - [ ] [Review readme import-figma-icons](https://github.com/Telefonica/mistica-icons/tree/import-figma-icons)" | |
# pr_draft: ${{ github.event.inputs.draft }} | |
# github_token: ${{ secrets.GITHUB_TOKEN }} |