-
Notifications
You must be signed in to change notification settings - Fork 66
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
Automate Browserlist DB Update #1664
Merged
adamstankiewicz
merged 4 commits into
master
from
abdullahwaheed/auto-update-browserlist
Jan 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ca6623f
feat: added cron github action to auto update brwoserlist DB periodic…
abdullahwaheed 669cc9e
Merge branch 'master' of github.com:openedx/paragon into abdullahwahe…
abdullahwaheed 44051cc
refactor: used a shared script to update broswerslist DB, create PR a…
abdullahwaheed 40a18d1
Merge branch 'master' into abdullahwaheed/auto-update-browserlist
adamstankiewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Update Browserlist DB | ||
on: | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
workflow_dispatch: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great to provide a manual way to trigger the workflow! 🙌 |
||
|
||
jobs: | ||
update-dep: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [16] | ||
npm: [8.5.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm install -g npm@${{ matrix.npm }} | ||
- run: make requirements | ||
|
||
- name: Update dependencies | ||
run: npx browserslist@latest --update-db | ||
|
||
- name: setup testeng-ci | ||
run: | | ||
git clone https://github.com/edx/testeng-ci.git | ||
cd $GITHUB_WORKSPACE/testeng-ci | ||
pip install -r requirements/base.txt | ||
- name: create pull request | ||
id: createpullrequest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.requirements_bot_github_token }} | ||
GITHUB_USER_EMAIL: ${{ secrets.requirements_bot_github_email }} | ||
run: | | ||
cd $GITHUB_WORKSPACE/testeng-ci | ||
python -m jenkins.pull_request_creator --repo-root=$GITHUB_WORKSPACE \ | ||
--target-branch="master" --base-branch-name="update-browserslist" \ | ||
--commit-message="chore: update browserslist" --pr-title="Update browserslist DB" \ | ||
--pr-body="Updated browserlist DB" --delete-old-pull-requests --output-pr-url-for-github-action |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this Github Action workflow essentially the same for all repos that use browserslist? If so, should we define the workflow once in a shared place that can be used by many repos?
Like what we do with the shared commit linting Github Action workflow file across all the repos: https://github.com/openedx/paragon/blob/master/.github/workflows/lockfileversion-check.yml#L11-L13
The shared Github Action workflows are defined here: https://github.com/openedx/.github/tree/master/workflow-templates, and should be accessible across repos without having to duplicate workflow files, resulting in more maintainable code.
Also, nit: let's change "browserlist" -> "browserslist" to match the actual name of browserslist.
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.
yeah it seems a right way to do this, let me create a PR there
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.
created this PR for shared workflow
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.
@abdullahwaheed Left some comments on the PR for the shared workflow!
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.
yes, updating that PR on the basis of your review