diff --git a/.github/workflows/lint-scripts-pr.yml b/.github/workflows/lint-scripts-pr.yml index c2d02ba97b..604d3f3ffe 100644 --- a/.github/workflows/lint-scripts-pr.yml +++ b/.github/workflows/lint-scripts-pr.yml @@ -23,18 +23,19 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 2 - - name: Environment variables - run: sudo -E bash -c set + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 - - name: "Shellcheck on changed files" - shell: bash {0} + - name: List all changed files run: | - for file in $(git diff --name-only master..HEAD); do - # We are only interested in BASH scripts - if grep -qE "#\!/" $file; then - shellcheck $file - fi + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + if grep -qE "#\!/" $file; then + + shellcheck $file + + fi done