Skip to content

Commit

Permalink
ci: Add tokens PR action
Browse files Browse the repository at this point in the history
  • Loading branch information
witwash committed Nov 29, 2023
1 parent 6eccf4c commit 58c38ab
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/tokens-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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

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

- name: Generate tokens files
run: melos gen_theme

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated commit of generated tailor files
file_pattern: "*tailor.dart"

- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
destination_branch: "master"
pr_title: "feat: Design Tokens Update"
pr_body: "Design Tokens were updated! This PR was created to update the code."
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 58c38ab

Please sign in to comment.