diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index acbbe2425..eb169fa0e 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -44,18 +44,30 @@ jobs: - name: Run dotnet restore run: dotnet restore + - name: base SHA + id: base-sha + run: | + echo "baseSHA=git merge-base origin/master" >> $GITHUB_OUTPUT + - name: Get all changed files id: changed-files + env: + BASE_SHA: ${{ steps.base-sha.outputs.baseSHA }} run: | - echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT + echo "changed_files=git diff --name-only $BASE_SHA $GITHUB_SHA" >> $GITHUB_OUTPUT - name: List all changed files env: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.changed_files }} run: | - for (file in ${ALL_CHANGED_FILES}){ - echo "$file was changed" - } + echo "$ALL_CHANGED_FILES" + - name: List all changed files + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.changed_files }} + run: | + for (file in ${ALL_CHANGED_FILES}){ + echo "$file was changed" + } - name: Run dotnet format on changed files run: |