GithubHelp home page GithubHelp logo

umens / browserslist-update-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from c2corg/browserslist-update-action

0.0 0.0 0.0 3.51 MB

A Github Action that runs `npx update-browserslist-db@latest` on a repository and proposes a pull request to merge updates.

License: MIT License

Shell 0.02% JavaScript 0.04% TypeScript 99.95%

browserslist-update-action's Introduction

browserslist-update-action

A GitHub Action that runs npx update-browserslist-db@latest on a repository and proposes a pull request to merge updates.

v2 vs v1

v1 uses command npx browserslist@latest --update-db which is now deprecated and to be removed in a future major browserslist release. It should be dropped in favor of v2 which uses new command npx update-browserslist-db@latest.

โš ๏ธ v2 requires at least Node 15 (npm 6). Stick to v1 otherwise.

Usage

name: Update Browserslist database

on:
  schedule:
    - cron: '0 2 1,15 * *'

permissions:
  contents: write
  pull-requests: write

jobs:
  update-browserslist-database:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Configure git
        run: |
          git config --global user.email "[email protected]"
          git config --global user.name "GitHub Action"
      - name: Update Browserslist database and create PR if applies
        uses: c2corg/browserslist-update-action@v2
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: browserslist-update
          base_branch: main
          commit_message: 'build: update Browserslist db'
          title: 'build: update Browserslist db'
          body: Auto-generated by [browserslist-update-action](https://github.com/c2corg/browserslist-update-action/)
          labels: 'chores, github action'
          reviewers: 'user1,user2,user3'
          teams: 'team1'

Important

This action can only create a pull request if the Allow GitHub Actions to create and approve pull requests option is enabled in Settings > Actions > General.

Action inputs

Inputs with defaults are optional.

Name Description Default
github_token GITHUB_TOKEN (contents: write, pull-requests: write) or a repo scoped Personal Access Token (PAT). GITHUB_TOKEN
branch The pull request branch name. browserslist-update
base_branch The target branch into which the pull request will be merged. master
directory For monorepos, the directory to switch to when running action .
commit_message The message to use when committing changes. Update caniuse database
title The title of the pull request. ๐Ÿ“ˆ Update caniuse database
body The body of the pull request. Caniuse database has been updated. Review changes, merge this PR and have a ๐Ÿบ.
labels A comma separated list of labels to apply to the pull request. (no label)
reviewers A comma separated list of users to be added to the the pull request reviewers list. (no users)
teams A comma separated list of teams to be added to the the pull request reviewers list. (no teams)

One will usually run this action on a cron basis (say, every day or week)

Action outputs

Name Description
has_pr true if changes were found and a pull request was created or updated, false otherwise.
pr_number The number of the pull requested created or updated, if applies.
pr_status Can be either created or updated depending on whether the pull request was created or updated.

Contributing

Edit / add GraphQL queries and mutations

src/generated folder contains generated type definitions based on queries. Run npm run graphql to update.

Release a version

npm run lint
npm run build
npm run pack

Or shortly

npm run all

Then bump version number in package.json and package-lock.json. Push commits.

Keep a major version tag synchronized with updates, e.g. if you publish version v2.0.3, then a v2 branch should be positioned at the same location.

browserslist-update-action's People

Contributors

brunobesson avatar dependabot[bot] avatar ai avatar coliff avatar jcfranco avatar nfmohit avatar hongaar avatar umens avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.