Skip to content

Commit

Permalink
Update browserslist and caniuse-lite packages weekly (#1413)
Browse files Browse the repository at this point in the history
## Summary:

This PR introduces a new Github Action that will run weekly (on Monday's at 7:30 am UTC - which maps to somewhere in the night in North America).

We will still need to manually approve and land these PRs to merge the changes (#security). Also, if we do not land the PR before this action runs again, the PR will simply be updated.

Issue: "none"

## Test plan:

We can run this action manually to test. Upon running it, a new PR with the title 'chore: update browserslist' should appear.

Author: jeremywiebe

Reviewers: jeremywiebe, somewhatabstract, benchristel, handeyeco

Required Reviewers:

Approved By: benchristel, somewhatabstract

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1413
  • Loading branch information
jeremywiebe authored Jul 18, 2024
1 parent 3ff40dd commit 738bb0c
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Weekly maintenance/update tasks
on:
# workflow_dispatch allows for manual triggering of the workflow
# Useful for testing that it works without waiting on the cron schedule.
workflow_dispatch:
schedule:
# https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#schedule
# ┌─────────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌─────── day of the month (1 - 31)
# │ │ │ ┌───── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌─── day of the week (0 - 6 or SUN-SAT)
# v v v v v
- cron: 30 7 * * 1 # in UTC
# Run on Mondays @ 7:30am UTC (3:30am EDT, 12:30 am PDT)

jobs:
update-browserslist:
name: Update the browserslist database (used by caniuse-lite)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v4

- name: Install & cache node_modules
uses: ./.github/actions/shared-node-cache
with:
node-version: ${{ matrix.node-version }}
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }}

- name: Update browserslist DB
run: npx update-browserslist@latest

- name: Create Pull Request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
team-reviewers: perseus, frontend-infra-web
commit-message: "chore: update browserslist"
title: Update browserslist
body: |
# Summary
Updates the `browserslist` and `caniuse-lite` npm packages
## Reviewing notes:
There should only be changes to the `yarn.lock` file in
this PR. Check that there is only 1 `caniuse-lite` package
reference in the `yarn.lock` file (the intent of this
update is to ensure that `caniuse-lite` is on the latest
version and that there aren't multiple, conflicting
versions that different tools might see).
If everything looks fine, please approve this PR and then
land it (either with the Big Green Merge Button ™️ or by
using `git land <this pr #>` in a terminal).

0 comments on commit 738bb0c

Please sign in to comment.