diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e4830751b..acbbe2425 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -47,14 +47,11 @@ jobs: - name: Get all changed files id: changed-files run: | - git fetch origin master - $BASE_SHA=$(git merge-base origin/master $GITHUB_SHA) - $CHANGED_FILES=$(git diff --name-only $BASE_SHA $GITHUB_SHA) - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT - name: List all changed files env: - ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.current_commit }} + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.changed_files }} run: | for (file in ${ALL_CHANGED_FILES}){ echo "$file was changed" @@ -63,8 +60,6 @@ jobs: - name: Run dotnet format on changed files run: | for file in $ALL_CHANGED_FILES; do - if [[ $file == *.cs ]]; then echo "Formatting $file" dotnet format $file --include $file --verify-no-changes --no-restore - fi done