-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
ffc629b
to
58c38ab
Compare
@ookami-kb, WDYT? 🤔 |
.github/workflows/tokens-pr.yml
Outdated
file_pattern: "*tailor.dart" | ||
|
||
- name: Create Pull Request | ||
uses: repo-sync/pull-request@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rather use GitHub CLI, it's pre-installed on action runners: https://cli.github.com/manual/gh_pr_create
.github/workflows/tokens-pr.yml
Outdated
run: melos gen_theme | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a separate action for that? Isn't it just a couple lines of code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For no particular reason tbh. I wrote it with commands at first, then I looked at the action and it felt cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather avoid using 3rd party actions unless they bring a lot of benefits.
|
||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" |
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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.
.github/workflows/tokens-pr.yml
Outdated
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.' |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
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 🤦
Summary
Added an action that would trigger on push in
design-tokens-**
branch. This action will create a PR tomaster
.This action will ensure we have the latest version of tokens from design-tokens. Right now we have an action that is committing new files to
design-tokens-${version}
branch. This action will create a PR and generate files that were touched by the tokens update.Testing steps
We'll need to check whether the trigger is working correctly and the PR is created.
Follow-up issues
Set up an action that would regeneratedonetheme_tailor
files in this same PR.Check during review