Skip to content

WEB-2340: First version of tag headline in rows #103

WEB-2340: First version of tag headline in rows

WEB-2340: First version of tag headline in rows #103

name: Import design tokens

Check failure on line 1 in .github/workflows/import-design-tokens.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/import-design-tokens.yml

Invalid workflow file

(Line: 17, Col: 26): Unrecognized named-value: 'github'. Located at position 1 within expression: github.event.inputs.ref
on:
workflow_dispatch:
inputs:
ref:
description: 'mistica-design repo changeset or branch'
required: false
default: 'production'
draft:
type: boolean
description: 'Create a draft PR'
required: false
default: false
branch:
description: 'Branch name for the PR. By default it is "import-design-tokens-${ref}"'
required: false
default: 'import-design-tokens-${{github.event.inputs.ref}}'
permissions:
contents: write
pull-requests: write
jobs:
import-design-tokens:
runs-on: ubuntu-latest
# Requires manual approval - uses GH_TOKEN_MISTICA to access private repo
environment: production
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Validate ref input
id: validate
env:
REF_INPUT: ${{ github.event.inputs.ref }}
run: |
# Validate: only safe characters for git refs
if ! echo "$REF_INPUT" | grep -qE '^[a-zA-Z0-9._/-]+$'; then
echo "Error: Invalid ref format"
exit 1
fi
echo "ref=$REF_INPUT" >> $GITHUB_OUTPUT
- name: Checkout mistica-design repo
uses: actions/checkout@v6
with:
repository: Telefonica/mistica-design
path: '.github/mistica-design'
ref: ${{ steps.validate.outputs.ref }}
# Requires GH_TOKEN_MISTICA to access private Telefonica/mistica-design repo
token: ${{ secrets.GH_TOKEN_MISTICA }}
persist-credentials: false
- name: Install dependencies
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
run: yarn install --immutable --immutable-cache
- name: Generate skins from design tokens
run: cd packages/generate-design-tokens && yarn && node index.js
- name: Prettier
run: yarn prettier src/skins --write
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_TOKEN_MISTICA }}
add-paths: 'src/skins'
commit-message: 'feat(skin): update design tokens'
title: 'feat(skin): update design tokens'
branch: ${{github.event.inputs.branch}}
reviewers: 'atabel,pladaria'
delete-branch: true
draft: ${{github.event.inputs.draft}}