feat: Support document grounding #370
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: documentation | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
grammar-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Determine Changed Files | |
id: changed-files | |
run: | | |
ALL_FILES=$(gh pr view ${{ github.event.pull_request.number }} --json files --jq '.files.[] | select(.additions > 0) | .path') | |
CHANGED_FILES="${ALL_FILES//$'\n'/,}" | |
echo "[DEBUG] Following files have been changed: $CHANGED_FILES" | |
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Vale | |
# vale fails if the PR is too large, e.g. when updating API docs | |
if: ${{ github.event.pull_request.changed_files < 100 }} | |
# You may pin to the exact commit or the version. | |
# uses: errata-ai/vale-action@0da98680790f89b8d5b685de9c264f55addc971b | |
uses: errata-ai/vale-action@reviewdog | |
with: | |
# version of 'vale' to use | |
# see https://github.com/errata-ai/vale for all releases | |
version: 3.7.1 | |
# changed files. computed in the step above | |
files: ${{ steps.changed-files.outputs.CHANGED_FILES }} | |
# the separator for the file list. we are using a comma (see step above) | |
separator: "," | |
# let review dog fail if there are errors | |
fail_on_error: true | |
env: | |
# Required | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |