Skip to content

Commit

Permalink
feat: added cron github action to auto update brwoserlist DB periodic…
Browse files Browse the repository at this point in the history
…ally
  • Loading branch information
abdullahwaheed committed Sep 5, 2022
1 parent 9eada96 commit 495c634
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions .github/workflows/update-browserlist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
name: Update Dependencies
name: Update Browserlist DB
on:
schedule:
- cron: '*/5 * * * *'
- cron: '*/5 * * * *' # for testing, once testing is done, we'll shift it to '0 0 * * 1' i.e every Monday

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
Expand All @@ -16,18 +23,24 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm install -g npm@${{ matrix.npm }}
- run: make requirements

- name: Update dependencies
run: npx browserslist@latest --update-db
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.TEST_AUTO_CREATE }}
commit-message: 'chore: update browserslist'
title: Update browserslist
body: |
- Dependency updates
Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
branch: update-browserslist

- 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

0 comments on commit 495c634

Please sign in to comment.