feat(gen): test typos workflow on docs #18
This file contains hidden or 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: Typos Check | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| branches: main | |
| jobs: | |
| typos: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get changed files in pages/ | |
| id: changed-files | |
| run: | | |
| # Get changed files in pages/ directory | |
| CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} HEAD | grep '^pages/') | |
| if [ -z "$CHANGED_FILES" ]; then | |
| echo "No changed files in pages/ directory." | |
| echo "files=none" >> $GITHUB_OUTPUT | |
| else | |
| echo "files<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGED_FILES" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Run typos on modified files in pages/ | |
| uses: crate-ci/typos@v1.40.0 | |
| if: steps.changed-files.outputs.files != 'none' | |
| with: | |
| files: ${{ steps.changed-files.outputs.files }} |