-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add action to update web-features tags
- Loading branch information
1 parent
529d4cf
commit afdb2ad
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Update web-features tags | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
schedule: | ||
- cron: "30 4 * * 1-5" | ||
|
||
jobs: | ||
update-web-features: | ||
if: github.repository == 'mdn/browser-compat-data' | ||
name: Update web-features-tags | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Checkout web-features | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: web-platform-dx/web-features | ||
path: web-features | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: npm | ||
|
||
- name: "Setup git" | ||
run: | | ||
git config user.email [email protected] | ||
git config user.name mdn-bot | ||
- name: Install | ||
run: npm ci | ||
|
||
- name: Install in web-features | ||
working-directory: ./web-features | ||
run: NODE_ENV=development npm ci | ||
|
||
- name: Update tags | ||
working-directory: ./web-features | ||
run: | | ||
echo "RESULT<<EOF" >> $GITHUB_ENV | ||
npm run migrate-to-bcd .. >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Delete web-features directory | ||
run: rm -r web-features | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} # need the rights to create and edit PRs | ||
commit-message: Update web-features tags | ||
author: mdn-bot <[email protected]> | ||
signoff: false | ||
branch: web-features-tags | ||
delete-branch: true | ||
add-paths: "*.json" | ||
title: "Update web-features tags" | ||
body: | | ||
The output of the `migrate-to-bcd` script is: | ||
${{ env.RESULT }} | ||
draft: false |