forked from rancher/rancher-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GH action workflow vale_3 to cover changes to versioned docs
- Loading branch information
1 parent
be4387a
commit 466d004
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: reviewdog | ||
on: [pull_request] | ||
|
||
jobs: | ||
vale-lint: | ||
name: runner / vale | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | ||
- name: Get all changed markdown files | ||
id: changed-markdown-files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
# Avoid using single or double quotes for multiline patterns | ||
files: | | ||
**.md | ||
separator: "," | ||
- name: List all changed files markdown files | ||
if: steps.changed-markdown-files.outputs.any_changed == 'true' | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} | ||
run: | | ||
echo ${ALL_CHANGED_FILES} | ||
for file in ${ALL_CHANGED_FILES}; do | ||
echo "$file was changed" | ||
echo "ALL_CHANGED_FILES=$ALL_CHANGED_FILES" >> $GITHUB_ENV | ||
done | ||
- name: No files changed? | ||
if: steps.changed-markdown-files.outputs.any_changed == 'false' | ||
env: | ||
ALL_CHANGED_FILES: ${{ 0 }} | ||
run: | | ||
echo "${ALL_CHANGED_FILES}" | ||
for file in ${ALL_CHANGED_FILES}; do | ||
echo "No filed changed" | ||
echo "ALL_CHANGED_FILES=$ALL_CHANGED_FILES" >> $GITHUB_ENV | ||
done | ||
- uses: errata-ai/vale-action@reviewdog | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
separator: "," | ||
files: ${{env.ALL_CHANGED_FILES}} |