Skip to content

Commit

Permalink
Merge branch 'test-vale' into test-vale-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Jun 17, 2024
2 parents 1d1dd62 + e404ef5 commit 76da8d9
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@ jobs:
reporter: github-pr-check
fail_on_error: true

- name: Install jq
run: sudo apt-get install -y jq

- name: Get changed files
id: changed-files
run: |
BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})
CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md')
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV
- name: Print Changed Files
run: echo $CHANGED_FILES

- name: Run Vale on changed files
run: |
BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})
CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md')
for file in $CHANGED_FILES; do
echo "Running Vale on $file"
vale --output=JSON $file > "vale_output_${file//\//_}.json"
vale --output=edit $file > "vale_output_${file//\//_}_edit.md"
done
- name: Upload Vale results
uses: actions/upload-artifact@v3
with:
name: vale-results
path: . # Uploads current directory by default

- name: Vale Check Summary
run: echo "Vale check completed successfully."

env:
GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
for file in ${{ env.CHANGED_FILES }}; do
echo "Running Vale on $file"
vale --output=JSON $file > "vale_output_${file//\//_}.json"
vale --output=edit $file > "vale_output_${file//\//_}_edit.md"
done
echo "Vale outputs:"
ls -l

0 comments on commit 76da8d9

Please sign in to comment.