-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate Browserlist DB Update (#642)
* feat: added cron github action to auto update brwoserlist DB periodically * feat: added workflow_dispatch for manual testing * fix: fixed error * fix: fixed indentation issue * fix: linting issue
- Loading branch information
1 parent
f6840bc
commit dba70b5
Showing
1 changed file
with
47 additions
and
0 deletions.
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,47 @@ | ||
name: Update Browserlist DB | ||
on: | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
workflow_dispatch: | ||
|
||
env: | ||
PR_TITLE: Update browserslist DB | ||
COMMIT_MESSAGE: "chore: update browserslist" | ||
PR_BODY: Updated browserlist DB | ||
BRANCH_NAME: "update-browserslist" | ||
|
||
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="${{ BRANCH_NAME }}" \ | ||
--commit-message="${{ COMMIT_MESSAGE }}" --pr-title="${{ PR_TITLE }}" \ | ||
--pr-body="${{ PR_BODY }}" --delete-old-pull-requests --output-pr-url-for-github-action |