Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ jobs:
modified_files: ${{ steps.check-modified-file-detail.outputs.modified_files }}
deleted_files: ${{ steps.check-modified-file-detail.outputs.deleted_files }}
renamed_files: ${{ steps.check-modified-file-detail.outputs.renamed_files }}
any_changed_vale_files: ${{ steps.check-vale-files.outputs.any_changed }}
Copy link
Member Author

@v1v v1v Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use feature flag IS_VALE_ACTIVATED. Thsi should hlep enabling this feature per repository, althought it requires to confirm if it works as expected

Suggested change
any_changed_vale_files: ${{ steps.check-vale-files.outputs.any_changed }}
any_changed_vale_files: ${{ steps.check-vale-files.outputs.any_changed && vars.IS_VALE_ACTIVATED == 'true' }}

steps:
- name: Checkout
if: contains(fromJSON('["push", "merge_group", "workflow_dispatch"]'), github.event_name)
Expand All @@ -167,6 +168,15 @@ jobs:
.github/**
README.md

- name: Get vale files
if: contains(fromJSON('["pull_request""]'), github.event_name)
id: check-vale-files
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
with:
files: |
docs/**/*.md
docs/**/*.adoc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need *.adoc files in the end, since the preview job is concerned only with markdown files anyway. +CC @reakaleek


- name: Get modified file detail
if: contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name)
id: check-modified-file-detail
Expand Down Expand Up @@ -656,3 +666,27 @@ jobs:
issue_number: prNum,
body
});

vale:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
deployments: none
id-token: none
needs:
- check
if: contains(fromJSON('["pull_request"]'), github.event_name) && needs.check.outputs.any_changed_vale_files == 'true'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Run Vale Linter
uses: elastic/vale-rules/lint@main

- name: Post Vale Results
uses: elastic/vale-rules/report@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Loading