Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Jun 14, 2024
1 parent 0e612d5 commit 08d82db
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:
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 "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')"
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: |
for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do
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"
Expand All @@ -46,7 +46,7 @@ jobs:
run: |
mkdir -p original_files
mkdir -p corrected_files
for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do
for file in ${{ env.CHANGED_FILES }}; do
echo "Copying $file to original_files/${file//\//_}.original"
cp "$file" "original_files/${file//\//_}.original"
echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}"
Expand All @@ -64,14 +64,12 @@ jobs:
with:
name: original-files
path: original_files/
continue-on-error: true

- name: Upload corrected files
uses: actions/upload-artifact@v3
with:
name: corrected-files
path: corrected_files/
continue-on-error: true

suggest: # Reviewdog suggestion job
runs-on: ubuntu-latest
Expand Down

0 comments on commit 08d82db

Please sign in to comment.