web-platform-dx/web-features

Automatically refresh dist files on Dependabot PRs

Opened this issue · 1 comments

When upgrading @mdn/browser-compat-data, it'd be nice if Dependabot PRs automatically refreshed the dist files. Then it'd be easier to review the effects of the upgrade.

Here's one possible approach for this. When Dependabot upgrades BCD (as in #894), a GitHub Actions workflow ought to to do something like this:

  1. If the PR branch matches the pattern dependabot/npm_and_yarn/mdn/browser-compat-data-, run npm run dist:refresh. The command must do what npm run dist does for every file with an existing .dist.yml file.
  2. Commit and changes to .dist.yml files that result.
  3. Push the changes back to the Dependabot PR branch.

dist.ts probably needs an option flag to just automatically find the applicable files, for this to work.

This sounds like a good idea. As a side effect, Dependabot would stop updating the PR. In order to make @dependabot recreate work, the GitHub Actions workflow could check the number of commits on the branch and push an update if it's exactly 1.