Update Browserslist database #30
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
name: Update Browserslist database | |
on: | |
schedule: | |
- cron: '0 6 15 * *' # 06:00 on the 15th of every month | |
workflow_dispatch: # or via Github UI | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-browserslist-database: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install packages | |
run: npm ci | |
- name: Update Browserslist database (old way) | |
run: npx browserslist@latest --update-db | |
- name: Rebuild API | |
run: npm run build-api | |
- name: Add & commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'ci: update browserslist database' | |
new_branch: 'ci/update-browserslist' | |
- name: Create PR | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh pr create --base "main" --head "ci/update-browserslist" --title "Update browserslist database" --label "ci" --body-file "./.github/workflows/pr-template.md" |