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

ci: Add tokens PR action #475

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Changes from 2 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
24 changes: 14 additions & 10 deletions .github/workflows/tokens-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -18,15 +20,17 @@ 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 "[email protected]"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have a user that we should use here? In design-tokens repo we use [email protected]

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, this one is fine.

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
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.'
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicking: use full-sized parameters (--branch, --head)

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, I see it's already updated 🤦

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}