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
| # .github/workflows/vale.yml | |
| name: Check AsciiDoc with Vale | |
| # This action runs on every push and pull request to the main branch. | |
| # You can customize this to fit your branching strategy. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| prose: | |
| name: Runner | |
| runs-on: ubuntu-latest # Use the latest Ubuntu runner | |
| steps: | |
| # Step 1: Check out the repository's code so the action can access it. | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| # Step 2: Set up Ruby and install Asciidoctor. | |
| # Vale can use Asciidoctor to accurately parse .adoc files. | |
| - name: Set up Ruby for Asciidoctor | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.1' # Or a version compatible with your project | |
| - name: Install Asciidoctor | |
| run: gem install asciidoctor | |
| # Step 3: Run the Vale GitHub Action. | |
| # This action automatically downloads Vale and runs it against your files. | |
| # It will use the configuration file (.vale.ini) from your repository. | |
| - name: Run Vale on AsciiDoc files | |
| uses: errata-ai/vale-action@v2 | |
| with: | |
| # Specify that Vale should only lint AsciiDoc files. | |
| files: '["*.adoc"]' | |
| # The action can post review comments directly on your pull requests. | |
| # This requires a GITHUB_TOKEN with appropriate permissions. | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |