Skip to content

Commit

Permalink
ci: Add tokens PR action (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
witwash authored Dec 4, 2023
1 parent b332653 commit 96a46d4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/tokens-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Design Tokens PR
on:
push:
branches:
- "design-tokens-**"

jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Set up Flutter
uses: "./.github/actions/setup"

- name: Generate tokens files
run: melos gen_theme

- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "mews-tech"
git add .
git commit -m "Update generated files"
git push origin ${{ github.ref_name }}
- name: Create Pull Request
run: |
gh pr create \
--base master \
--head ${{ github.ref_name }} \
--title 'feat: Design Tokens Update' \
--body 'Design Tokens were updated! This PR was created to update the code.' \
--reviwer MewsSystems/tech.mo.platform.owners
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 6 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ command:
workspaceChangelog: false

scripts:
gen_icons: melos exec --scope="storybook" -- "dart utils/gen_icons.dart $MELOS_ROOT_PATH/optimus/lib/fonts/config/ lib/stories/icon && dart format lib/stories/icon/icons_list.dart"
gen_icons:
run: melos exec --scope="storybook" -- "dart utils/gen_icons.dart $MELOS_ROOT_PATH/optimus/lib/fonts/config/ lib/stories/icon && dart format lib/stories/icon/icons_list.dart"
description: Generate the list of all icons for the storybook story
gen_theme:
run: melos exec --depends-on=build_runner -- "dart run build_runner build -d"
description: Build all generated files

packages:
- "**"

0 comments on commit 96a46d4

Please sign in to comment.