Skip to content

Commit

Permalink
fix: fail doc-style action when wrong Vale config is present (#470)
Browse files Browse the repository at this point in the history
Co-authored-by: Roberto Pastor Muela <[email protected]>
  • Loading branch information
jorgepiloto and RobPasMue authored Apr 25, 2024
1 parent 7d34a0e commit 5534a0e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions doc-style/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,37 @@ 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 $major)" >> $GITHUB_ENV
- name: "Verify Vale's configuration layout according to selected version"
shell: bash
run: |
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 ]
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 5534a0e

Please sign in to comment.