Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: vale check #474

Merged
merged 7 commits into from
Apr 25, 2024
Merged
Changes from 6 commits
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
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 $major)" >> $GITHUB_ENV
RobPasMue marked this conversation as resolved.
Show resolved Hide resolved
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
RobPasMue marked this conversation as resolved.
Show resolved Hide resolved
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
Loading