-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
update(ci): add update emoji schedule workflow #2436
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
This looks great, @Koooooo-7. A few minor naming nitpicks, but otherwise this looks good.
Has this been tested? If not, it seems like we could by removing a data
property entry from /src/core/render/emoji-data.js
, committing the change, then waiting to see if this workflow generates the expected PR.
I will update it.
I tested it from a fork. ( the screenshot is gotten from that). And we don't need mock a emoji update since there already exists emoji update between our emojiData and github. |
branch_name="update-emoji-data-$current_date" | ||
pr_title="update(emoji): Sync emoji data with GitHub emoji API [$current_date]" | ||
git config --global user.email "actions@github.com" | ||
git config --global user.name "GitHub Actions" | ||
|
||
git checkout -b $branch_name | ||
git add src/core/render/emoji-data.js | ||
git add docs/emoji.md | ||
git commit -m "update(emoji): Sync emoji data with GitHub emoji API [$current_date]" | ||
unique_branch_name=$branch_name-$(git log -1 --pretty=%h) | ||
git checkout -b $unique_branch_name | ||
git push origin $unique_branch_name | ||
gh pr create --title "$pr_title" --body "Found updated github emojis need to sync, PTAL @docsifyjs/reviewers :robot:." --base develop |
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.
This can be simplified by using the action
https://github.com/stefanzweifel/git-auto-commit-action
https://github.com/peter-evans/create-pull-request
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.
Thx for it.
I know those actions but according to our plain needs,using them gonna makes the action more complicated to me.
- file change check steps and ::OUTPUT.
- commit action on pre if-condition.
- pr with change condition with if-condition also.
Personally, I think we could put them together without much actions dependencies for now.
How about we use this now and when we have more requirements on it,we do the refinement then?
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.
Looks like @sy-records prefers we replace the git commands with actions, but otherwise this looks good to me.
I will negotiate with him and do the updates if needs. |
Sounds good, @Koooooo-7. Looks like this is ready to merge whenever you and @sy-records resolve the actions discussion. :) Thanks for getting this up and running so quickly! |
Summary
Add update emoji schedule workflow to daily update emoji data.
Changes:
UTC 2:00
daily run, or manually trigger.build:emoji
out ofbuild
.try catch
fromemoji.js
to ensure thewriteJS
andwirteMarkdown
in sametransaction
(both success or failed), so, we could just check the last write file (src/core/render/emoji-data.js
) changes and add them all.update-emoji-data-$current_date-${last commit hash 7}
to be an unique branch commit, it makes it possible that we could manually trigger multi times in a day or it were be trigger both in schedule and manually does.Others:
build:emoji
inrelease.sh
since it is unlikely happen as per our discussion.close #2434
PR
Branch details
Related issue, if any:
What kind of change does this PR introduce?
Build-related changes
For any code change,
Does this PR introduce a breaking change?
No
Tested in the following browsers: