Skip to content

Commit

Permalink
feat: added a shared workflow to auto update browserslist in the MFEs (
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullahwaheed authored Dec 16, 2022
1 parent afcbf75 commit 8f3182d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/update-browserslist-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update Browserslist DB
on:
- workflow_call

jobs:
update-dep:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
npm: [8.5.x]

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: Install dependencies
run: npm install -g npm@${{ matrix.npm }}

- name: Install Packages
run: npm ci

- name: Update dependencies
run: npx update-browserslist-db@latest

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.requirements_bot_github_token }}
commit-message: 'chore: update browserslist DB'
title: Update browserslist DB
body: |
Updated browserslist DB
branch: update-browserslist-db

- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.requirements_bot_github_token }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash
11 changes: 11 additions & 0 deletions workflow-templates/update-browserslist-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Run weekly to create a PR that updates browserslist DB

name: Update Browserslist DB
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
update-browserslist:
uses: openedx/.github/.github/workflows/update-browserslist-db.yml@master
7 changes: 7 additions & 0 deletions workflow-templates/update-browserslist.properties-db.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Auto Update Browserslist DB Workflow",
"description": "Run weekly to create a PR that updates browserslist DB",
"iconName": "edx-workflow-template-icon",
"categories": [],
"filePatterns": []
}

0 comments on commit 8f3182d

Please sign in to comment.