Update browserslist #140
This file contains hidden or 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 | |
| on: | |
| schedule: | |
| - cron: "15 14 * * 3" | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: latest | |
| cache: 'npm' | |
| - name: Update browsers list | |
| run: npx --yes update-browserslist-db@latest | |
| - name: Check for Changes | |
| id: check_changes | |
| run: | | |
| if [[ -n "$(git diff --exit-code)" ]]; then | |
| echo "Changes detected." | |
| echo "::set-output name=has_changes::true" | |
| else | |
| echo "No changes detected." | |
| echo "::set-output name=has_changes::false" | |
| fi | |
| - name: Save updated db | |
| if: steps.check_changes.outputs.has_changes == 'true' | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git add package-lock.json | |
| git commit -m "chore: bump browserslist" | |
| git push origin HEAD:main |