Spec suggestion: also crawl spec with Reffy and report potential issues #29
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: Create a PR for the suggested spec | |
on: | |
issue_comment: | |
# Details for types below can be found at: | |
# https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads?actionType=edited#issues | |
types: | |
# Job triggered when an issue comment is created (or edited) | |
- created | |
- edited | |
jobs: | |
prepare: | |
name: Prepare update to specs.json | |
runs-on: ubuntu-latest | |
# TODO: Check comment user permissions more thoroughly, for instance using | |
# the REST API (see link below). This is going to be needed if we decide to | |
# remove the PR step and have the bot merge directly to the `main` branch. | |
# https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#get-repository-permissions-for-a-user | |
if: ${{ github.event.comment.author_association == 'MEMBER' && contains(github.event.comment.body, '@browser-specs-bot pr') }} | |
steps: | |
- name: Setup node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Install dependencies | |
run: npm ci | |
- name: Check suggested spec and create PR | |
run: | | |
git config user.name "browser-specs-bot" | |
git config user.email "<>" | |
git remote set-url --push origin https://x-access-token:[email protected]/$GITHUB_REPOSITORY | |
npx browser-specs build $NUMBER --pr | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
NUMBER: ${{ github.event.issue.number }} |