-
Notifications
You must be signed in to change notification settings - Fork 228
58 lines (56 loc) · 2.41 KB
/
vale.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This action gets all changed markdown files in /docs and /versioned_docs using tj-actions/changed-files@v42
# It compares new commits in the PR with the base commit (github.event.pull_request.base.sha)
# It checks if no markdown files are changed
# It shows a count of markdown files and lists all changed markdown files
# It uses Vale (https://vale.sh/docs/vale-cli/installation/) to provide feedback base off the SUSE Style Guide / OpenSUSE style rules (https://github.com/openSUSE/suse-vale-styleguide)
name: Style check
on: [pull_request]
jobs:
vale-lint:
name: runner / vale
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
continue-on-error: true
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
submodules: true
- name: Get all changed markdown files
continue-on-error: true
id: changed-markdown-files
uses: tj-actions/changed-files@v42
with:
# Avoid using single or double quotes for multiline patterns
files: |
docs/**
versioned_docs/**
separator: ","
base_sha: ${{ github.event.pull_request.base.sha }}
env:
ALL_CHANGED_FILES: ${{ 0 }}
- name: No files changed?
continue-on-error: true
if: steps.changed-markdown-files.outputs.any_changed == 'false'
run: |
echo "No files changed"
echo "ALL_CHANGED_FILES=$ALL_CHANGED_FILES" >> $GITHUB_ENV
- name: List all changed files markdown files
continue-on-error: true
if: steps.changed-markdown-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }}
ALL_CHANGED_FILES_COUNT: ${{ steps.changed-markdown-files.outputs.all_changed_files_count }}
SHA: ${{ github.head_ref }}
HEAD: ${{ github.base_ref }}
run: |
echo "Total Files Changed:" ${ALL_CHANGED_FILES_COUNT}
echo ${ALL_CHANGED_FILES}
echo "ALL_CHANGED_FILES=$ALL_CHANGED_FILES" >> $GITHUB_ENV
- uses: errata-ai/[email protected]
continue-on-error: true
if: steps.changed-markdown-files.outputs.any_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
separator: ", "
files: ${{ env.ALL_CHANGED_FILES }}