-
-
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
chore: automate compat-data update #14248
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52125/ |
Hi there 👋 I finally use the I add a compare script to check if it's relevant to update or not. If commits are equal it throws. To wrap up:
cc @JLHwung |
- name: Get latest kangax/compat-data commit | ||
id: lastCommit | ||
run: echo "::set-output name=sha1::$(node ./scripts/update-compat-data/get-last-commit.sh)" | ||
- name: Compare last kangax/compat-data commit with current one |
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 don't think that we need this step; we don't have it for the parser tests updater.
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.
Thanks for your feedback @nicolo-ribaudo 🙌 :)
My initial was to avoid useless computations, doesn't that make sense?
set -e | ||
export GIT_DIR=./packages/babel-compat-data/build/compat-table | ||
git fetch -q origin HEAD | ||
git rev-parse FETCH_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.
Since this script and bump-data-compat-version.sh
are not used anywhere else, we could just inline them in the action as a single step:
- name: Update to latest kangax/compat-data commit
run: perl -i -pe 's/^COMPAT_TABLE_COMMIT.+$/COMPAT_TABLE_COMMIT='$(git rev-parse FETCH_HEAD)'/' ./packages/babel-compat-data/download-compat-table.sh
with:
GIT_DIR: ./packages/babel-compat-data/build/compat-table
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 think it is good to leave it as-is: It is more convenient to debug the update workflow in local machine.
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'm okay with the bot approach here ^^
1246873
to
4a58c22
Compare
c11c42f
to
8997ec2
Compare
8997ec2
to
19a760e
Compare
b28a485
to
13d996c
Compare
Co-authored-by: Armano <[email protected]>
This works! Action run: https://github.com/nicolo-ribaudo/babel/runs/6692355681 |
I'm merging this to test if it also works in this repo, or if there are any permissions problems. |
Hi 👋
This pull request tends to automate compat-data update.
@JLHwung shows me the
Test262
automation as a model for this one:sha
in the./packages/babel-compat-data/download-compat-table.sh
A word about testing: nothing in the
scripts
folder was tested. I'd like to create a sub-foldertest
and add a test for the js script. WDYT?