Skip to content

Commit

Permalink
try vale CircleCi
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 17, 2024
1 parent e66ca8d commit 902d760
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
37 changes: 37 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,43 @@ jobs:
- run:
name: Lint Markdown
command: pnpm markdownlint
- run:
# See https://circleci.com/developer/orbs/orb/circleci/vale as reference
name: Install Vale
command: |
#!/bin/bash
VALE_STR_CLI_VERSION=3.3.0
mkdir /tmp/vale-extract
cd /tmp/vale-extract
GZIPPED_OUTPUT="vale.tar.gz"
BINARY_URL=https://github.com/errata-ai/vale/releases/download/v${VALE_STR_CLI_VERSION}/vale_${VALE_STR_CLI_VERSION}_Linux_64-bit.tar.gz
curl -sSL "$BINARY_URL" -o "${GZIPPED_OUTPUT}"
if [ ! -s "${GZIPPED_OUTPUT}" ]; then
echo "Downloaded file is empty"
rm "${GZIPPED_OUTPUT}"
exit 1
fi
tar -xzf "${GZIPPED_OUTPUT}"
$SUDO mv vale /usr/local/bin
rm "${GZIPPED_OUTPUT}"
# validate installation
if [[ -z "$(command -v vale)" ]]; then
echo "vale installation failed"
exit 1
else
echo "vale installation successful"
vale --version
exit 0
fi
- run:
name: Lint writing style
command: |
vale sync
pnpm run valelint
test_static:
<<: *default-job
steps:
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/vale-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ jobs:
name: runner / vale
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
pull-requests: write
steps:
- id: token
name: "Get VALE_TOKEN"
env:
PART1: ghp_ZYwO164FpcD3
PART2: GoWE0qA4LumLdNft3G3H85ob
run: 'echo "VALE_TOKEN=$PART1$PART2" >> $GITHUB_OUTPUT'
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: errata-ai/vale-action@38bf078c328061f59879b347ca344a718a736018 # v2.1.0
continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed
with:
fail_on_error: true
reporter: github-pr-review
token: ${{steps.token.outputs.VALE_TOKEN}}
reporter: github-pr-check
token: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"eslint:ci": "eslint . --report-unused-disable-directives --ext .js,.ts,.tsx --max-warnings 0",
"stylelint": "stylelint --reportInvalidScopeDisables --reportNeedlessDisables \"docs/**/*.{js,ts,tsx}\"",
"markdownlint": "markdownlint-cli2 \"**/*.md\"",
"valelint": "git ls-files | grep -h \".md$\" | xargs vale --filter='.Level==\"error\"'",
"prettier": "pretty-quick --ignore-path .eslintignore",
"prettier:all": "prettier --write . --ignore-path .eslintignore",
"size:snapshot": "node --max-old-space-size=4096 ./scripts/sizeSnapshot/create",
Expand Down

0 comments on commit 902d760

Please sign in to comment.