|
| 1 | +--- |
| 2 | +name: Lint with Vale on pull requests |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - "**.adoc" |
| 7 | + - "**.md" |
| 8 | + - content/learn/** |
| 9 | + - content/patterns/** |
| 10 | + - content/contribute/** |
| 11 | + - modules/** |
| 12 | +jobs: |
| 13 | + vale-lint: |
| 14 | + name: Linting with Vale |
| 15 | + runs-on: ubuntu-latest |
| 16 | + permissions: |
| 17 | + contents: read |
| 18 | + pull-requests: write |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v5 |
| 22 | + with: |
| 23 | + fetch-depth: 3 |
| 24 | + - name: Install dependencies |
| 25 | + run: > |
| 26 | + sudo DEBIAN_FRONTEND=noninteractive apt-get update |
| 27 | +
|
| 28 | + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-upgrade asciidoctor jq |
| 29 | + - name: Install Vale |
| 30 | + run: > |
| 31 | + wget -O vale.tar.gz |
| 32 | + https://github.com/errata-ai/vale/releases/download/v3.12.0/vale_3.12.0_Linux_64-bit.tar.gz |
| 33 | +
|
| 34 | + tar -xzf vale.tar.gz |
| 35 | +
|
| 36 | + sudo mv vale /usr/local/bin/ |
| 37 | +
|
| 38 | + vale --version |
| 39 | + - name: Run Vale linting script |
| 40 | + env: |
| 41 | + GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} |
| 42 | + GITHUB_REPOSITORY: ${{ github.repository }} |
| 43 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 44 | + run: > |
| 45 | + # Always pass, even if the script fails |
| 46 | +
|
| 47 | + set +e |
| 48 | +
|
| 49 | +
|
| 50 | + # Run the Vale linting script |
| 51 | +
|
| 52 | + ./.github/workflows/scripts/lintwithvale.sh \ |
| 53 | + "${{ github.event.pull_request.base.sha }}" \ |
| 54 | + "${{ github.event.pull_request.head.sha }}" || { |
| 55 | + echo "⚠️ Vale linting script encountered an error, but workflow will continue." |
| 56 | + } |
| 57 | +
|
| 58 | +
|
| 59 | + # Always exit successfully |
| 60 | +
|
| 61 | + exit 0 |
| 62 | + - name: Workflow summary |
| 63 | + if: always() |
| 64 | + run: > |
| 65 | + echo "✅ Vale linting workflow completed" |
| 66 | +
|
| 67 | + echo "📋 This workflow is configured to always pass, regardless of linting results" |
| 68 | +
|
| 69 | + echo "🔍 Check the previous step logs for Vale linting details" |
| 70 | +
|
| 71 | + echo "💬 PR comment is added if Vale finds issues." |
0 commit comments