mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Add Github Action to calculate changed files (#4438)
* Fix branch diff detection * Update lint-scripts-pr.yml
This commit is contained in:
21
.github/workflows/lint-scripts-pr.yml
vendored
21
.github/workflows/lint-scripts-pr.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user