From c59b8e5a62cf92c2d75e2dd880b3b2d20e5b6bbe Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:50:55 +0100 Subject: [PATCH] add --- .github/workflows/vale.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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