Skip to content

Commit

Permalink
fix: vale check (#474)
Browse files Browse the repository at this point in the history
Co-authored-by: Jorge Martinez <jorge.martinezgarrido@ansys.com>
  • Loading branch information
RobPasMue and jorgepiloto authored Apr 25, 2024
1 parent afb1380 commit 7c46e54
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions doc-style/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,43 @@ runs:
uses: actions/checkout@v4
if: inputs.checkout == 'true'

- uses: ansys/actions/_logging@main
with:
level: "INFO"
message: >
Ensure Vale configuration follows the right layout for the specified
version of Vale.
- name: "Check Vale's version"
shell: bash
run: |
version=${{ inputs.vale-version }}
vale_major_version=$( echo $version | cut -d '.' -f 1)
echo "VALE_MAJOR_VERSION=$(echo $vale_major_version)" >> $GITHUB_ENV
echo "VALE_MAJOR_VERSION set to $vale_major_version" # Add this line for debugging
- name: "Verify Vale's configuration layout according to selected version"
shell: bash
run: |
if [ -z "$VALE_MAJOR_VERSION" ]; then
echo "VALE_MAJOR_VERSION is not set."
exit 1
fi
if [ $VALE_MAJOR_VERSION -ge 3 ]; then
if [ ! -d ./doc/styles/config/vocabularies ]; then
echo "Projects using Vale >=v3 require a doc/styles/config/vocabularies directory."
echo "See migration guide https://actions.docs.ansys.com/version/stable/migrations/docs-style-vale-version-update.html"
exit 1
fi
else
if [ ! -d ./doc/styles/Vocab ]; then
echo "Projects using Vale <=v2 require a doc/styles/Vocab directory. Consider updating your Vale version to v3."
echo "See migration guide https://actions.docs.ansys.com/version/stable/migrations/docs-style-vale-version-update.html"
exit 1
fi
fi
- name: "Run Vale"
uses: errata-ai/vale-action@reviewdog
env:
Expand Down

0 comments on commit 7c46e54

Please sign in to comment.