Skip to content

Commit

Permalink
chore(Mistica Tokens generator): IOS-10974 Allow ref param (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
amegias authored Feb 3, 2025
1 parent 7f5165e commit 83925e7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/generate-mistica-tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Generate Mistica Tokens

on:
workflow_dispatch:
inputs:
ref:
description: 'mistica-design repo changeset or branch'
required: false
default: 'production'

concurrency:
group: ci-${{ github.ref }}
Expand All @@ -23,7 +28,7 @@ jobs:
working-directory: scripts/mistica-skin-generator

- name: Generate tokens
run: npm run generate
run: npm run generate -- ${{github.event.inputs.ref}}
working-directory: scripts/mistica-skin-generator

- name: Create Pull Request
Expand Down
10 changes: 8 additions & 2 deletions scripts/mistica-skin-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ const BRANDS = [
const BRANCH = 'production';

const run = async () => {
let branch = BRANCH;
if (process.argv.length > 2) {
const args = process.argv.slice(2);
branch = args[0];
}

const brandsWithTokens = await Promise.all(
BRANDS.map((brand) => {
console.log(`Getting ${brand.misticaDesignFileName} tokens from mistica-design/${BRANCH}...`);
return downloadTokens(BRANCH, brand.misticaDesignFileName).then((tokens) => ({
console.log(`Getting ${brand.misticaDesignFileName} tokens from mistica-design/${branch}...`);
return downloadTokens(branch, brand.misticaDesignFileName).then((tokens) => ({
brand,
tokens,
}));
Expand Down

0 comments on commit 83925e7

Please sign in to comment.