Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-10974 Allow ref param #423

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.argv returns something like:

[
  '/opt/homebrew/Cellar/node/23.5.0/bin/node',
  '/xxxxxxx/mistica-ios/scripts/mistica-skin-generator/index.js',
  'firstParam',
  'secondParam',
  '...'
]

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
Loading