From 58c38abb6a1b70e9bce2282ad467ecf8999fe909 Mon Sep 17 00:00:00 2001 From: Vitalij Vascenko Date: Tue, 28 Nov 2023 12:00:49 +0100 Subject: [PATCH 1/4] ci: Add tokens PR action --- .github/workflows/tokens-pr.yml | 32 ++++++++++++++++++++++++++++++++ melos.yaml | 7 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tokens-pr.yml diff --git a/.github/workflows/tokens-pr.yml b/.github/workflows/tokens-pr.yml new file mode 100644 index 00000000..3f1168de --- /dev/null +++ b/.github/workflows/tokens-pr.yml @@ -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 }} diff --git a/melos.yaml b/melos.yaml index 783feaa6..f091fe48 100644 --- a/melos.yaml +++ b/melos.yaml @@ -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: - "**" From a32adeaa17502f812b5240c6909ec8d55adbc2ca Mon Sep 17 00:00:00 2001 From: Vitalij Vascenko Date: Mon, 4 Dec 2023 02:32:00 +0100 Subject: [PATCH 2/4] Update commit step --- .github/workflows/tokens-pr.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tokens-pr.yml b/.github/workflows/tokens-pr.yml index 3f1168de..2764c08f 100644 --- a/.github/workflows/tokens-pr.yml +++ b/.github/workflows/tokens-pr.yml @@ -10,6 +10,8 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} - name: Set up Flutter uses: "./.github/actions/setup" @@ -18,10 +20,14 @@ jobs: 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" + run: | + git config --local user.email "tech.account@mewssystems.com" + 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 uses: repo-sync/pull-request@v2 From d27f146a988b1cd15df79ba8212759cc13d6ba21 Mon Sep 17 00:00:00 2001 From: Vitalij Vascenko Date: Mon, 4 Dec 2023 02:37:59 +0100 Subject: [PATCH 3/4] Update PR step --- .github/workflows/tokens-pr.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tokens-pr.yml b/.github/workflows/tokens-pr.yml index 2764c08f..76b02563 100644 --- a/.github/workflows/tokens-pr.yml +++ b/.github/workflows/tokens-pr.yml @@ -30,9 +30,7 @@ jobs: git push origin ${{ github.ref_name }} - 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 }} + run: | + gh pr create -B master -H ${{ github.ref_name }} --title 'feat: Design Tokens Update' --body 'Design Tokens were updated! This PR was created to update the code.' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c685eabce8a76fff2af4ffe8a62730a69e5ce7b9 Mon Sep 17 00:00:00 2001 From: Vitalij Vascenko Date: Mon, 4 Dec 2023 02:53:37 +0100 Subject: [PATCH 4/4] Add a reviewer group --- .github/workflows/tokens-pr.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tokens-pr.yml b/.github/workflows/tokens-pr.yml index 76b02563..c1cbef63 100644 --- a/.github/workflows/tokens-pr.yml +++ b/.github/workflows/tokens-pr.yml @@ -31,6 +31,11 @@ jobs: - name: Create Pull Request run: | - gh pr create -B master -H ${{ github.ref_name }} --title 'feat: Design Tokens Update' --body 'Design Tokens were updated! This PR was created to update the code.' + 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 }}