Skip to content

Commit adf1293

Browse files
themr0cclaude
andauthored
[RHDHBUGS-3010]: Fix shellcheck workflow on deleted .sh files (#2102)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e24133b commit adf1293

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/shellcheck.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,16 @@ jobs:
8989
- name: Get changed shell scripts
9090
id: changed-files
9191
run: |
92-
# Get list of changed .sh files
92+
# Get list of changed .sh files that still exist (exclude deletions)
9393
git fetch origin ${{ github.base_ref }}
94-
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '\.sh$' || echo "")
94+
ALL_CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '\.sh$' || echo "")
95+
CHANGED_FILES=""
96+
while IFS= read -r file; do
97+
if [ -n "$file" ] && [ -f "$file" ]; then
98+
CHANGED_FILES="${CHANGED_FILES:+$CHANGED_FILES
99+
}$file"
100+
fi
101+
done <<< "$ALL_CHANGED"
95102
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
96103
echo "$CHANGED_FILES" >> $GITHUB_OUTPUT
97104
echo "EOF" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)