Skip to content

Commit 0fa6474

Browse files
authored
Add vale linting and reporting to preview-build.yml (#2343)
* Add vale linting and reporting to preview-build.yml * Test vale * Adjust vale-rules/lint usage * Revert * Re-add condition * Remove fetch-depth: 0
1 parent fb65cf6 commit 0fa6474

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/preview-build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ on:
5858
type: boolean
5959
default: false
6060
required: false
61+
enable-vale-linting:
62+
description: 'Enable vale linting'
63+
type: boolean
64+
default: false
65+
required: false
66+
6167

6268
permissions:
6369
contents: read
@@ -656,3 +662,27 @@ jobs:
656662
issue_number: prNum,
657663
body
658664
});
665+
666+
vale:
667+
if: >
668+
startsWith(github.event_name, 'pull_request')
669+
&& inputs.enable-vale-linting == true
670+
&& needs.check.outputs.any_modified
671+
runs-on: ubuntu-latest
672+
needs: check
673+
permissions:
674+
contents: read
675+
pull-requests: write
676+
deployments: none
677+
id-token: none
678+
steps:
679+
- name: Checkout
680+
uses: actions/checkout@v6
681+
- name: Run Vale Linter
682+
uses: elastic/vale-rules/lint@main
683+
with:
684+
files: ${{ needs.check.outputs.all_changed_files }}
685+
- name: Post Vale Results
686+
uses: elastic/vale-rules/report@main
687+
with:
688+
download_artifacts: false

0 commit comments

Comments
 (0)