diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6782de30ef3..755c8c9bb00 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,20 +27,20 @@ jobs: - 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 + 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]')" - name: Print Changed Files run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - 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 + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); 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