Add Github Action to calculate changed files (#4438)

* Fix branch diff detection

* Update lint-scripts-pr.yml
This commit is contained in:
Igor Pečovnik
2022-11-15 09:05:43 +01:00
committed by GitHub
parent 83da1ddeeb
commit ed9077e973

View File

@@ -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