Update DB #758
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 DB | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 12 * * *' | |
jobs: | |
browserlist-db: | |
runs-on: ubuntu-latest | |
env: | |
GH_BROWSERLIST_BRANCH: update-browserlist-db | |
name: Updates the browserlist db | |
steps: | |
- name: 🥪 Put the default branch name into env so the next steps can access it | |
run: echo "GH_BASE_BRANCH=${GITHUB_REF_NAME}" >> $GITHUB_ENV | |
- name: ⬇️ Checkout | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS using the obtained nvm version | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: | | |
args: [--frozen-lockfile] | |
- name: 🚧 Create a branch | |
uses: peterjgrainger/action-create-branch@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
branch: ${{ env.GH_BROWSERLIST_BRANCH }} | |
- name: 🚀 Run the update-db command | |
run: npx browserslist@latest --update-db | |
- name: 🚧 Push the branch | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: 'pnpm-lock.yaml' | |
branch: update-browserlist-db | |
branch_mode: create | |
# Determines the way the action fills missing author name and email. Three options are available: | |
# - github_actor -> UserName <[email protected]> | |
# - user_info -> Your Display Name <[email protected]> | |
# - github_actions -> github-actions <email associated with the github logo> | |
# Default: github_actor | |
default_author: github_actions | |
message: 'perf(browserlist): Deliver the Browserslist DB update' | |
pull: 'NO-PULL' | |
push: origin ${{ env.GH_BROWSERLIST_BRANCH }} --force | |
- name: 🏗 Create Pull-Request into dist branch | |
uses: repo-sync/pull-request@v2 | |
with: | |
pr_title: 'perf(browserlist): Deliver the Browserslist DB update' | |
pr_body: ':crown: *An automated PR from the Browserlist workflow*' | |
source_branch: ${{ env.GH_BROWSERLIST_BRANCH }} | |
destination_branch: ${{ env.GH_BASE_BRANCH }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} |